August 14, 2009

C++0x Forward Enum Declarations Cut Down Compilation Time and Dependencies

very declaration of an enum type must be a complete definition containing a full list of its enumerators. However, in some use cases declaring an enumeration without providing the enumerators list is desirable. For example, you may use a forward declaration like this… enum class Direction; …instead of repeating the