Quantcast
Channel: Is it a good idea to typedef pointers? - Stack Overflow
Viewing all articles
Browse latest Browse all 16

Answer by Dan Hook for Is it a good idea to typedef pointers?

$
0
0

If you do this, you will be unable to create STL containers of const pSomeStruct since the compiler reads:

list<const pSomeStruct> structs;

as

list<SomeStruct * const> structs;

which is not a legal STL container since the elements are not assignable.

See this question .


Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>