This is a discussion on another vector question within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Elysia This guarantees that it takes a pointer to something of type mytype. Yes, but if you ...
I've decided this is a rather weak argument. I think I'll agree with you, Elysia.
Naw its cool Elysia. And in fact I do agree with her on this one mostly because typedefs are something that have become evil in the industry. Sometimes the quest towards making things portable is commendable, but sometimes that just doesn't seem to be the rationale behind the typedefs.
To be honest, I think its a territorial issue more often than anything else. "Psh.. an int... what the hell is an int? If you want to use my library then you will use a my_int. And don't you dare think of trying to sneak in a SOCKET in there!"
And true, sometimes (such as in the example of descriptors) typedefs merely distinguish between integral types and a descriptor, but people are very liberal about their type defining these days. There need only be enough types to be portable, and debuggable and nothing more.