X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fmeta.h;h=6998c5d1b8a712d69176a556e7c677bb745b9ec2;hb=73e50b0c608292113512de4be35737facc77d9ef;hp=a13f5cb3a5714de60aba9a7bdc5682370aac110a;hpb=eb4b0279cb697b3350cd34acfd7fdddad5227325;p=libs%2Fcore.git diff --git a/source/core/meta.h b/source/core/meta.h index a13f5cb..6998c5d 100644 --- a/source/core/meta.h +++ b/source/core/meta.h @@ -23,6 +23,11 @@ struct RemoveReference { typedef T Type; }; +template +struct RemoveConstReference +{ typedef typename RemoveConst::Type>::Type Type; }; + + template struct EnableIf; @@ -43,13 +48,28 @@ 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)) }; }; }; + +struct CheckEqualityComparable: Sfinae +{ + static int &v; + template + static Yes f(int (*)[sizeof(reinterpret_cast(v)==reinterpret_cast(v))]); + using Sfinae::f; +}; + +template +struct IsEqualityComparable: Sfinae::Evaluate { }; + } // namespace Msp #endif