typedef and struct inside class definition?

ChrainY發表於2024-11-12

additionally.

typedefs defined inside a class are "part of the class", that is to say the typedef isn't visible/accessible outside the class functions unless you fully qualify it by class::typedefname
Additionally the typedef is also public, protected or private depending so it's access is also restricted to code outside the class.

The C++ template library makes heavy use of typedefs to achieve all sorts of handy features.

相關文章