blob: e19f664f62db5d45a55f3cbbf81436fec8d2f60d [file] [log] [blame]
Brian Silvermanbca6d252018-08-04 23:36:16 -07001// 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
6
7namespace boost { namespace concept_checking {
8
9// Here we implement the "metafunction" that detects whether a
10// constraints metafunction exists
11typedef char yes;
12typedef char (&no)[2];
13
14template <class Model, void (Model::*)()>
15struct wrap_constraints {};
16
17template <class Model>
18inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
19inline no has_constraints_(...);
20
21template <class Model>
22struct has_constraints
23{
24 BOOST_STATIC_CONSTANT(
25 bool
26 , value = sizeof( concept_checking::has_constraints_((Model*)0) ) == 1 );
27};
28
29}} // namespace boost::concept_checking
30
31#endif // BOOST_CONCEPT_CHECK_HAS_CONSTRAINTS_DWA2006429_HPP