X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fmeta.h;h=8015f42370837e2ba6633acb0ee9b50a87ca9273;hp=923096517dba8132a873de68a79344ab6e2910b1;hb=292aed8e23ea543b089d5f2a73000de4640befe7;hpb=ff0d3252cad08280b9c320b3fea5a11c80406c23 diff --git a/source/core/meta.h b/source/core/meta.h index 9230965..8015f42 100644 --- a/source/core/meta.h +++ b/source/core/meta.h @@ -1,6 +1,8 @@ #ifndef MSP_CORE_META_H_ #define MSP_CORE_META_H_ +#include + namespace Msp { template @@ -21,6 +23,11 @@ struct RemoveReference { typedef T Type; }; +template +struct RemoveConstReference +{ typedef typename RemoveConst::Type>::Type Type; }; + + template struct EnableIf; @@ -41,10 +48,13 @@ struct Sfinae struct Yes { char c[2]; }; struct No { char c; }; - template + template + static No f(...); + + template struct Evaluate { - enum { value = (s==sizeof(Yes)) }; + enum { value = (sizeof(C::template f(0))==sizeof(Yes)) }; }; };