Expand|Select|Wrap|Line Numbers
- __STL_CLASS_REQUIRES(_Tp, _Assignable);
However, this macro seems to do nothing int the cource code.
The Following is the Macro Definition in concept_checks.h:
Expand|Select|Wrap|Line Numbers
- #ifndef __STL_USE_CONCEPT_CHECKS
- // Some compilers lack the features that are necessary for concept checks.
- // On those compilers we define the concept check macros to do nothing.
- #define __STL_REQUIRES(__type_var, __concept) do {} while(0)
- #define __STL_CLASS_REQUIRES(__type_var, __concept) \
- static int __##__type_var##_##__concept
Expand|Select|Wrap|Line Numbers
- #ifdef __STL_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE
- #define __STL_CLASS_REQUIRES(__type_var, __concept)
Expand|Select|Wrap|Line Numbers
- #else
- // Use this macro inside of template classes, where you would
- // like to place requirements on the template arguments to the class
- // Warning: do not pass pointers and such (e.g. T*) in as the __type_var,
- // since the type_var is used to construct identifiers. Instead typedef
- // the pointer type, then use the typedef name for the __type_var.
- #define __STL_CLASS_REQUIRES(__type_var, __concept) \
- typedef void (* __func##__type_var##__concept)( __type_var ); \
- template <__func##__type_var##__concept _Tp1> \
- struct __dummy_struct_##__type_var##__concept { }; \
- static __dummy_struct_##__type_var##__concept< \
- __concept##_concept_specification< \
- __type_var>::__concept##_requirement_violation> \
- __dummy_ptr_##__type_var##__concept
They only declare some variables, but does nothing?
So, Is the COMPLIER that finally defines macros like
__STL_CLASS_REQUIRES?
Thanks!C++ Geeks!