What is the (recent?) significance of adding "_t" to class names in C++? [duplicate]
Possible Duplicates:
What does a type开发者_JS百科 followed by _t (underscore-t) represent? What does the postfix “_t” stand for in C?
I've seen this more as of late. These are not typically templated classes, but rather just ordinary classes. Their names are all sensible, but they all tend to end with _t. I can't point to the libraries because they are proprietary, but I'm observing this in completely different libraries, across problem domains, so I'm assuming there is some kind of change in the naming conventions being used. Is this documented as a best practice anywhere?
As other already pointed, it's a naming convention used for type names (most of the time, typedefs). It have been used in the standard library (from the start?) so it's not recent at all.
For example you often see std::size_t and it's everywhere in the STL.
Some old C code I've read also use this convention so the origin might even be from C naming conventions, where you have to typedef a struct to get a "type".
精彩评论