ecl/concepts/macros.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ECL_CONCEPTS_MACROS_HPP_
13 #define ECL_CONCEPTS_MACROS_HPP_
14 
15 /*****************************************************************************
16 ** Namespaces
17 *****************************************************************************/
18 
19 namespace ecl {
20 namespace concepts {
21 
22 /*****************************************************************************
23 ** Classes
24 *****************************************************************************/
36  template <void(*)()> struct InstantiateConceptCheck {};
37 
44  template <class Model>
45  void CONCEPT_CHECK_FAILED()
46  {
47  ((Model*)0)->~Model();
48  }
49 
57  template <class Model>
58  struct CONCEPT_CHECK
59  {
60  InstantiateConceptCheck< CONCEPT_CHECK_FAILED<Model> > x;
61  enum { instantiate = 1 };
62  };
66 }; // namespace concepts
67 }; // namespace ecl
68 
69 #define ecl_concept_check_name_expand(Name) ConceptCheck ## Name
70 #define ecl_concept_check_name(Name) ecl_concept_check_name_expand(Name)
71 
92 #define ecl_compile_time_concept_check( Model ) \
93  enum { ecl_concept_check_name(__LINE__) = ecl::concepts::CONCEPT_CHECK< Model >::instantiate }
94 
116 #define ecl_compile_time_concept_test( Model ) \
117  ecl_compile_time_concept_check( Model ); \
118  ~Model()
119 
123 #endif /* ECL_CONCEPTS_MACROS_HPP_ */


xbot_driver
Author(s): Roc, wangpeng@droid.ac.cn
autogenerated on Sat Oct 10 2020 03:27:37