News for hackers. Stuff that matters.
Re:Typedefs & Linus by Jach on Thursday October 14, 2010 @04:20AM (#1790234)
I agree except for the part about typedef'ing pointers. If you never typecast a pointer, then you can't ever have compile time and run time encapsulation (better than C++ gives with "private"!) through opaque pointers...
Re:Typedefs & Linus by pieter on Thursday October 14, 2010 @06:35AM (#1790453)
Why not? Just don't ship the definition of your struct in your headers, only declare them.
Re:Typedefs & Linus by jedbrown on Thursday October 14, 2010 @07:46AM (#1790560)
The API is more confusing if they always have to lug around the extra * and type out struct if they can never dereference it. I am strongly in favor of typedefing pointer types that are strictly private.