Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:44:40

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_CHECK_MSVC_DWA2006429_HPP
0005 # define BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
0006 
0007 # ifdef BOOST_OLD_CONCEPT_SUPPORT
0008 #  include <boost/concept_check/has_constraints.hpp>
0009 #  include <boost/type_traits/conditional.hpp>
0010 # endif
0011 
0012 
0013 // This implementation works on GCC and Comeau, but has actually been
0014 // fairly carefully tuned to work on GCC versions starting with
0015 // gcc-2.95.x.  If you're trying to get an additional compiler to pass
0016 // the tests you might consider breaking out a separate gcc.hpp and
0017 // starting over on the general case.
0018 namespace boost
0019 {
0020   namespace concept_checking
0021   {
0022     template <void(*)()> struct instantiate {};
0023   }
0024   
0025   template <class ModelFn> struct concept_check_;
0026 
0027   template <class Model>
0028   void concept_check_failed()
0029   {
0030       ((Model*)0)->~Model();
0031   }
0032 
0033   template <class Model>
0034   struct concept_check
0035   {
0036       concept_checking::instantiate<concept_check_failed<Model> > x;
0037       enum { instantiate = 1 };
0038   };
0039 
0040 # ifdef BOOST_OLD_CONCEPT_SUPPORT
0041   
0042   template <class Model>
0043   void constraint_check_failed()
0044   {
0045       ((Model*)0)->constraints();
0046   }
0047 
0048   template <class Model>
0049   struct constraint_check
0050   {
0051       concept_checking::instantiate<constraint_check_failed<Model> > x;
0052       enum { instantiate = 1 };
0053   };
0054   
0055   template <class Model>
0056   struct concept_check_<void(*)(Model)>
0057     : conditional<
0058           concept_checking::has_constraints<Model>::value
0059         , constraint_check<Model>
0060         , concept_check<Model>
0061       >::type
0062   {};
0063   
0064 # else
0065   
0066   template <class Model>
0067   struct concept_check_<void(*)(Model)>
0068     : concept_check<Model>
0069   {};
0070   
0071 # endif
0072   
0073   // Usage, in class or function context:
0074   //
0075   //     BOOST_CONCEPT_ASSERT((UnaryFunctionConcept<F,bool,int>));
0076 #  define BOOST_CONCEPT_ASSERT( ModelInParens )                             \
0077   enum { BOOST_PP_CAT(boost_concept_check,__LINE__) =                       \
0078          ::boost::concept_check_<void(*) ModelInParens>::instantiate        \
0079   }
0080 }
0081 
0082 #endif // BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP