From: <syn...@us...> - 2006-11-09 13:13:06
|
Revision: 776 http://svn.sourceforge.net/loki-lib/?rev=776&view=rev Author: syntheticpp Date: 2006-11-09 05:12:57 -0800 (Thu, 09 Nov 2006) Log Message: ----------- also produce a verbose error message with gcc, make the macro more readable Modified Paths: -------------- trunk/include/loki/Register.h Modified: trunk/include/loki/Register.h =================================================================== --- trunk/include/loki/Register.h 2006-11-05 13:09:00 UTC (rev 775) +++ trunk/include/loki/Register.h 2006-11-09 13:12:57 UTC (rev 776) @@ -108,14 +108,25 @@ /// 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 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |