From: Mikko Rasa Date: Tue, 26 Mar 2013 20:37:08 +0000 (+0200) Subject: Use the Sfinae helper struct from mspcore X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=8b7cadfa3b5a72ecf466c589e1c8328d8500b588;p=libs%2Fdatafile.git Use the Sfinae helper struct from mspcore --- diff --git a/source/collection.h b/source/collection.h index 7a09f50..a7ac59b 100644 --- a/source/collection.h +++ b/source/collection.h @@ -17,17 +17,14 @@ namespace DataFile { Helper struct to determine whether a Loader has a Collection typedef. */ template -struct NeedsCollection +struct NeedsCollection: public Sfinae { - struct Yes { char c[2]; }; - struct No { char c; }; - template static Yes f(typename U::Collection *); template static No f(...); - enum { value = (sizeof(f(0))==sizeof(Yes)) }; + enum { value = Evaluate(0))>::value }; }; class CollectionItemTypeBase;