My answer is a clear "No".
Why?
Well, first of all, you simply exchange a single character *
for another single character p
. That is zero gain. This alone should keep you from doing this as it is always bad to do extra stuff that's pointless.
Second, and that is the important reason, the *
carries meaning that is not good to hide. If I pass something to a function like this
void foo(SomeType bar);void baz() { SomeType myBar = getSomeType(); foo(myBar);}
I do not expect the meaning of myBar
to be changed by passing it to foo()
. After all, I'm passing by value, so foo()
only ever sees a copy of myBar
right? Not when SomeType
is aliased to mean some kind of pointer! Especially when that pointer acts as a reference to some kind of object whose value is basically the meaning of the pointer: I won't care that the pointer itself does not change (due to pass-by-value), I'm interested in whether the object changes or not (the object behind the pointer).
This applies both to C pointers and C++ smart pointers: If you hide the fact that they are pointers to your users, you will create confusion that is totally unnecessary. So, please, don't alias your pointers.
(I believe the habit of typedefing pointer types is just a misguided attempt to hide how many stars one has as a programmer http://wiki.c2.com/?ThreeStarProgrammer .)