X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fmeta.h;h=923096517dba8132a873de68a79344ab6e2910b1;hb=8db2c378e1d006afb792d829857e866541bf81a5;hp=0034512b6ec2bea573ffbcc34115fc8562a5cac8;hpb=c7afef88380ebebc8c2b04e48664d73281ec8848;p=libs%2Fcore.git diff --git a/source/core/meta.h b/source/core/meta.h index 0034512..9230965 100644 --- a/source/core/meta.h +++ b/source/core/meta.h @@ -11,6 +11,7 @@ template struct RemoveConst { typedef T Type; }; + template struct RemoveReference { typedef T Type; }; @@ -19,6 +20,34 @@ template struct RemoveReference { typedef T Type; }; + +template +struct EnableIf; + +template +struct EnableIf +{ typedef R Yes; }; + +template +struct EnableIf +{ typedef R No; }; + + +/** +Common fragments used in SFINAE-based decider constructs. +*/ +struct Sfinae +{ + struct Yes { char c[2]; }; + struct No { char c; }; + + template + struct Evaluate + { + enum { value = (s==sizeof(Yes)) }; + }; +}; + } // namespace Msp #endif