src/core/int-to-type.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Sat, 04 Jul 2009 08:15:48 +0200
changeset 4654 2eaebe77d66b
parent 1680 151684970a80
permissions -rw-r--r--
Added tag ns-3.5 for changeset c975274c9707
     1 #ifndef INT_TO_TYPE_H
     2 #define INT_TO_TYPE_H
     3 
     4 namespace ns3 {
     5 
     6 /**
     7  * This trivial template is extremely useful, as explained in
     8  * "Modern C++ Design", p29, section 2.4, 
     9  * "Mapping Integral Constants to Types"
    10  */
    11 template <int v>
    12 struct IntToType
    13 {
    14   enum v_e {value = v};
    15 };
    16 
    17 } // namespace ns3
    18 
    19 #endif /* INT_TO_TYPE_H */