X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftype.h;h=fdd040d81adccd82b53b9e9509b48b4348b70ed8;hb=82d55799ee319bf2db357f2d5aded01ad0e2076f;hp=85cfec40f2afc9aa79f38d646baf64dea473cd0a;hpb=bdd957e58dc6fdaa3cac1202daf0d16d41491278;p=libs%2Fdatafile.git diff --git a/source/type.h b/source/type.h index 85cfec4..fdd040d 100644 --- a/source/type.h +++ b/source/type.h @@ -2,6 +2,7 @@ #define MSP_DATAFILE_TYPE_H_ #include +#include #include namespace Msp { @@ -11,8 +12,10 @@ struct Symbol { std::string name; + Symbol() { } + template - Symbol(const T &n): name(lexical_cast(n)) { } + Symbol(const T &n): name(lexical_cast(n)) { } template operator T() const { return lexical_cast(name); } }; @@ -62,20 +65,16 @@ const char valid_signatures[] = 0 }; -template -struct HasLoadType +struct CheckLoadType: Sfinae { - struct Yes { char c[2]; }; - struct No { char c; }; - - template - static Yes f(typename U::LoadType *); - template - static No f(...); - - enum { value = (sizeof(f(0))==sizeof(Yes)) }; + template + static Yes f(typename T::LoadType *); + using Sfinae::f; }; +template +struct HasLoadType: Sfinae::Evaluate { }; + template::value> struct TypeInfo;