00001 #ifndef INT_TO_TYPE_H 00002 #define INT_TO_TYPE_H 00003 00004 namespace ns3 { 00005 00006 /** 00007 * This trivial template is extremely useful, as explained in 00008 * "Modern C++ Design", p29, section 2.4, 00009 * "Mapping Integral Constants to Types" 00010 */ 00011 template <int v> 00012 struct IntToType 00013 { 00014 enum v_e {value = v}; 00015 }; 00016 00017 } // namespace ns3 00018 00019 #endif /* INT_TO_TYPE_H */