Internal typedefs in C++ - good style or bad style?

前端 未结 9 1440
天涯浪人
天涯浪人 2020-12-07 07:28

Something I have found myself doing often lately is declaring typedefs relevant to a particular class inside that class, i.e.

class Lorem
{
    typedef boost         


        
9条回答
  •  青春惊慌失措
    2020-12-07 07:40

    The STL does this type of thing all the time - the typedefs are part of the interface for many classes in the STL.

    reference
    iterator
    size_type
    value_type
    etc...
    

    are all typedefs that are part of the interface for various STL template classes.

提交回复
热议问题