Q:

Is it advisable to declare pointer to heap memory as `const` ALWAYS?

T *p = new T();

For the pointer on heap, there can be disastrous operations such as,
p++;  // (1) scope missed
p = new T(); // (2) re-assignment

Which would result in memory leaks or crashes due to wrong delete. Apart from using smart pointers, is it advisable always to make heap pointer a const;
T* const p = new T();  // now "p" is not modifiable

This question is in regards of maintaining good programming practice and coding style.

A:

Well, about the only time I use raw heap pointers is if writing my own data structures. and if you used a const pointer for them, your data structure immediately becomes unassignable. which may or may not be what you want. 

A:

I hesitate to say always, but what you propose seems reasonable for many/most cases.  Const correctness is something most C++ folks pay a fair bit of attention to in function parameters, but not so much in local (or even member) variables.  We might be better off to do so.

