1 // Copyright David Abrahams 2006. Distributed under the Boost
2 // Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4 #ifndef BOOST_CONCEPT_CHECK_HAS_CONSTRAINTS_DWA2006429_HPP
5 # define BOOST_CONCEPT_CHECK_HAS_CONSTRAINTS_DWA2006429_HPP
7 namespace boost { namespace concept_checking {
9 // Here we implement the "metafunction" that detects whether a
10 // constraints metafunction exists
12 typedef char (&no)[2];
14 template <class Model, void (Model::*)()>
15 struct wrap_constraints {};
17 template <class Model>
18 inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
19 inline no has_constraints_(...);
21 template <class Model>
22 struct has_constraints
24 BOOST_STATIC_CONSTANT(
26 , value = sizeof( concept_checking::has_constraints_((Model*)0) ) == 1 );
29 }} // namespace boost::concept_checking
31 #endif // BOOST_CONCEPT_CHECK_HAS_CONSTRAINTS_DWA2006429_HPP