comparison DEPENDENCIES/generic/include/boost/concept/detail/msvc.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
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_MSVC_DWA2006429_HPP
5 # define BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
6
7 # include <boost/preprocessor/cat.hpp>
8 # include <boost/concept/detail/backward_compatibility.hpp>
9
10 # ifdef BOOST_OLD_CONCEPT_SUPPORT
11 # include <boost/concept/detail/has_constraints.hpp>
12 # include <boost/mpl/if.hpp>
13 # endif
14
15
16 namespace boost { namespace concepts {
17
18
19 template <class Model>
20 struct check
21 {
22 virtual void failed(Model* x)
23 {
24 x->~Model();
25 }
26 };
27
28 # ifndef BOOST_NO_PARTIAL_SPECIALIZATION
29 struct failed {};
30 template <class Model>
31 struct check<failed ************ Model::************>
32 {
33 virtual void failed(Model* x)
34 {
35 x->~Model();
36 }
37 };
38 # endif
39
40 # ifdef BOOST_OLD_CONCEPT_SUPPORT
41
42 namespace detail
43 {
44 // No need for a virtual function here, since evaluating
45 // not_satisfied below will have already instantiated the
46 // constraints() member.
47 struct constraint {};
48 }
49
50 template <class Model>
51 struct require
52 : mpl::if_c<
53 not_satisfied<Model>::value
54 , detail::constraint
55 # ifndef BOOST_NO_PARTIAL_SPECIALIZATION
56 , check<Model>
57 # else
58 , check<failed ************ Model::************>
59 # endif
60 >::type
61 {};
62
63 # else
64
65 template <class Model>
66 struct require
67 # ifndef BOOST_NO_PARTIAL_SPECIALIZATION
68 : check<Model>
69 # else
70 : check<failed ************ Model::************>
71 # endif
72 {};
73
74 # endif
75
76 # if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
77
78 //
79 // The iterator library sees some really strange errors unless we
80 // do things this way.
81 //
82 template <class Model>
83 struct require<void(*)(Model)>
84 {
85 virtual void failed(Model*)
86 {
87 require<Model>();
88 }
89 };
90
91 # define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \
92 enum \
93 { \
94 BOOST_PP_CAT(boost_concept_check,__LINE__) = \
95 sizeof(::boost::concepts::require<ModelFnPtr>) \
96 }
97
98 # else // Not vc-7.1
99
100 template <class Model>
101 require<Model>
102 require_(void(*)(Model));
103
104 # define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \
105 enum \
106 { \
107 BOOST_PP_CAT(boost_concept_check,__LINE__) = \
108 sizeof(::boost::concepts::require_((ModelFnPtr)0)) \
109 }
110
111 # endif
112 }}
113
114 #endif // BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP