Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:06

0001 // Copyright David Abrahams 2006. Distributed under the Boost
0002 // Software License, Version 1.0. (See accompanying
0003 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0004 #ifndef BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
0005 # define BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
0006 
0007 # include <boost/type_traits/integral_constant.hpp>
0008 # include <boost/config/workaround.hpp>
0009 # include <boost/concept/detail/backward_compatibility.hpp>
0010 
0011 namespace boost { namespace concepts {
0012 
0013 namespace detail
0014 { 
0015 
0016 // Here we implement the metafunction that detects whether a
0017 // constraints metafunction exists
0018   typedef char yes;
0019   typedef char (&no)[2];
0020 
0021   template <class Model, void (Model::*)()>
0022   struct wrap_constraints {};
0023     
0024 #if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580) || defined(__CUDACC__)
0025   // Work around the following bogus error in Sun Studio 11, by
0026   // turning off the has_constraints function entirely:
0027   //    Error: complex expression not allowed in dependent template
0028   //    argument expression
0029   inline no has_constraints_(...);
0030 #else
0031   template <class Model>
0032   inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
0033   inline no has_constraints_(...);
0034 #endif
0035 }
0036 
0037 // This would be called "detail::has_constraints," but it has a strong
0038 // tendency to show up in error messages.
0039 template <class Model>
0040 struct not_satisfied
0041 {
0042     BOOST_STATIC_CONSTANT(
0043         bool
0044       , value = sizeof( detail::has_constraints_((Model*)0) ) == sizeof(detail::yes) );
0045     typedef boost::integral_constant<bool, value> type;
0046 };
0047 
0048 }} // namespace boost::concepts::detail
0049 
0050 #endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP