Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/concept_check/has_constraints.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
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 | |
6 | |
7 namespace boost { namespace concept_checking { | |
8 | |
9 // Here we implement the "metafunction" that detects whether a | |
10 // constraints metafunction exists | |
11 typedef char yes; | |
12 typedef char (&no)[2]; | |
13 | |
14 template <class Model, void (Model::*)()> | |
15 struct wrap_constraints {}; | |
16 | |
17 template <class Model> | |
18 inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0); | |
19 inline no has_constraints_(...); | |
20 | |
21 template <class Model> | |
22 struct 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 |