
20 Apr
2011
20 Apr
'11
7:25 a.m.
[Wouter Van Alboom]
I've done something similar to Boost.Conversion for (un)marschalling data to some API. Rather than template functions I was using structs, the ones that were trivial were defined using some traits template <class C__> struct CastMarshal; template <> struct CastMarshal<char> { typedef int tyM; }; template <> struct CastMarshal<MyEnum> { typedef int tyM; }; template <> struct CastMarshal<int> { typedef int tyM; };
As an aside, note that _Leading_underscore_capital and DoubleUnderscoreAnywhere__ names are reserved exclusively for use by the compiler and Standard Library, everywhere. C__ contains a double underscore and is therefore reserved. Stephan T. Lavavej Visual C++ Libraries Developer