A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
int-to-type.h
Go to the documentation of this file.
1 #ifndef INT_TO_TYPE_H
2 #define INT_TO_TYPE_H
3 
4 namespace ns3 {
5 
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 */
This trivial template is extremely useful, as explained in "Modern C++ Design", p29, section 2.4, "Mapping Integral Constants to Types".
Definition: int-to-type.h:12