
29 Dec
2004
29 Dec
'04
1:07 p.m.
mpl has int_ which wraps an int value, but I've needed something similar for other types, in particular, for enumerated types. I'm suggesting something like: //template to create a type from a value of some type. template < typename ValueType //type of value to be "typified"
struct value2type { typedef ValueType value_type ; template < value_type ValueInstance //value to be typified. > struct instance //the type created from ValueInstance {}; }; The name is modelled after In2Type in Alexandrescu's _Modern C++ Design_ which is also where the "typified" comes from. Could this template, or something like it be added to mpl?