also produce a verbose error message with gcc, make the macro more readable

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@776 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2006-11-09 13:12:57 +00:00
parent f3aa021c9a
commit 9f8c7ea485

View file

@ -108,13 +108,24 @@ namespace Loki
/// see test/Register
////////////////////////////////////////////////////////////////////////////////
#define LOKI_CONCATE(a,b,c,d) a ## b ## c ## d
#define LOKI_CONCAT(a,b,c,d) LOKI_CONCATE(a,b,c,d)
#define LOKI_CHECK_CLASS_IN_LIST( CLASS , LIST ) \
\
struct Loki_##CLASS##LIST_OK{typedef int class_##CLASS##_is_not_in_##LIST;};\
typedef Loki::Select<Loki::TL::IndexOf<LIST, CLASS>::value == -1, \
CLASS,Loki_##CLASS##LIST_OK >::Result IsInList##CLASS##LIST; \
typedef IsInList##CLASS##LIST::class_##CLASS##_is_not_in_##LIST \
isInListTest##CLASS##LIST;
struct LOKI_CONCAT(check_,CLASS,_isInList_,LIST) \
{ \
typedef int LOKI_CONCAT(ERROR_class_,CLASS,_isNotInList_,LIST); \
}; \
typedef Loki::Select<Loki::TL::IndexOf<LIST, CLASS>::value == -1, \
CLASS, \
LOKI_CONCAT(check_,CLASS,_isInList_,LIST)> \
::Result LOKI_CONCAT(CLASS,isInList,LIST,result); \
typedef LOKI_CONCAT(CLASS,isInList,LIST,result):: \
LOKI_CONCAT(ERROR_class_,CLASS,_isNotInList_,LIST) \
LOKI_CONCAT(ERROR_class_,CLASS,_isNotInList__,LIST);
} // namespace Loki