Vaca::Enum< Base > Struct Template Reference

#include <Enum.h>

List of all members.


Detailed Description

template<typename Base>
struct Vaca::Enum< Base >

This class is used to define enumerations "a la" C++0x.

"Base" policy must be like this:

 struct Base {
   enum enumeration { ... };
   static const enumeration default_value = ...;
 };

Example of how to use this:

 struct NumbersEnum
 {
   enum enumeration {
     Zero,
     One,
     Two,
     Three,
   };
   static const enumeration default_value = Zero;
 };
 typedef Enum<NumbersEnum> Numbers;

 main() {
   Numbers n1, n2 = Numbers::One;
   n1 = n2;
   n2 = Numbers::Two;
 }

Public Types

typedef Base::enumeration enumeration

Public Member Functions

 Enum ()
 Enum (enumeration value)
 operator enumeration () const
Enum< Base > & operator= (enumeration value)

Private Attributes

enumeration m_value

Member Typedef Documentation

template<typename Base>
typedef Base::enumeration Vaca::Enum< Base >::enumeration


Constructor & Destructor Documentation

template<typename Base>
Vaca::Enum< Base >::Enum (  )  [inline]

template<typename Base>
Vaca::Enum< Base >::Enum ( enumeration  value  )  [inline]


Member Function Documentation

template<typename Base>
Vaca::Enum< Base >::operator enumeration (  )  const [inline]

template<typename Base>
Enum<Base>& Vaca::Enum< Base >::operator= ( enumeration  value  )  [inline]


Member Data Documentation

template<typename Base>
enumeration Vaca::Enum< Base >::m_value [private]