X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Ftype.h;h=fdd040d81adccd82b53b9e9509b48b4348b70ed8;hp=f40657eb14a07003a295cb979ae4813523183d17;hb=08ca2d33416e549bd3d071a164ed2a98765dda4b;hpb=a887b3f7518605c22e4b70eeb9fe136acb2ea632 diff --git a/source/type.h b/source/type.h index f40657e..fdd040d 100644 --- a/source/type.h +++ b/source/type.h @@ -2,6 +2,7 @@ #define MSP_DATAFILE_TYPE_H_ #include +#include #include namespace Msp { @@ -64,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;