$search
00001 00008 /***************************************************************************** 00009 ** Ifdefs 00010 *****************************************************************************/ 00011 00012 #ifndef ECL_CONCEPTS_MACROS_HPP_ 00013 #define ECL_CONCEPTS_MACROS_HPP_ 00014 00015 /***************************************************************************** 00016 ** Namespaces 00017 *****************************************************************************/ 00018 00019 namespace ecl { 00020 namespace concepts { 00021 00022 /***************************************************************************** 00023 ** Classes 00024 *****************************************************************************/ 00036 template <void(*)()> struct InstantiateConceptCheck {}; 00037 00044 template <class Model> 00045 void CONCEPT_CHECK_FAILED() 00046 { 00047 ((Model*)0)->~Model(); 00048 } 00049 00057 template <class Model> 00058 struct CONCEPT_CHECK 00059 { 00060 InstantiateConceptCheck< CONCEPT_CHECK_FAILED<Model> > x; 00061 enum { instantiate = 1 }; 00062 }; 00066 }; // namespace concepts 00067 }; // namespace ecl 00068 00069 #define ecl_concept_check_name_expand(Name) ConceptCheck ## Name 00070 #define ecl_concept_check_name(Name) ecl_concept_check_name_expand(Name) 00071 00092 #define ecl_compile_time_concept_check( Model ) \ 00093 enum { ecl_concept_check_name(__LINE__) = ecl::concepts::CONCEPT_CHECK< Model >::instantiate } 00094 00116 #define ecl_compile_time_concept_test( Model ) \ 00117 ecl_compile_time_concept_check( Model ); \ 00118 ~Model() 00119 00123 #endif /* ECL_CONCEPTS_MACROS_HPP_ */