Chris@16: // Copyright David Abrahams 2006. Distributed under the Boost Chris@16: // Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: #ifndef BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP Chris@16: # define BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP Chris@16: Chris@16: # include Chris@16: # include Chris@16: Chris@16: # ifdef BOOST_OLD_CONCEPT_SUPPORT Chris@16: # include Chris@16: # include Chris@16: # endif Chris@16: Chris@16: // This implementation works on Comeau and GCC, all the way back to Chris@16: // 2.95 Chris@16: namespace boost { namespace concepts { Chris@16: Chris@16: template Chris@16: struct requirement_; Chris@16: Chris@16: namespace detail Chris@16: { Chris@16: template struct instantiate {}; Chris@16: } Chris@16: Chris@16: template Chris@16: struct requirement Chris@16: { Chris@16: static void failed() { ((Model*)0)->~Model(); } Chris@16: }; Chris@16: Chris@16: struct failed {}; Chris@16: Chris@16: template Chris@16: struct requirement Chris@16: { Chris@16: static void failed() { ((Model*)0)->~Model(); } Chris@16: }; Chris@16: Chris@16: # ifdef BOOST_OLD_CONCEPT_SUPPORT Chris@16: Chris@16: template Chris@16: struct constraint Chris@16: { Chris@16: static void failed() { ((Model*)0)->constraints(); } Chris@16: }; Chris@16: Chris@16: template Chris@16: struct requirement_ Chris@16: : mpl::if_< Chris@16: concepts::not_satisfied Chris@16: , constraint Chris@16: , requirement Chris@16: >::type Chris@16: {}; Chris@16: Chris@16: # else Chris@16: Chris@16: // For GCC-2.x, these can't have exactly the same name Chris@16: template Chris@16: struct requirement_ Chris@16: : requirement Chris@16: {}; Chris@16: Chris@16: # endif Chris@16: Chris@101: // Version check from https://svn.boost.org/trac/boost/changeset/82886 Chris@101: // (boost/static_assert.hpp) Chris@101: #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))) Chris@101: #define BOOST_CONCEPT_UNUSED_TYPEDEF __attribute__((unused)) Chris@101: #else Chris@101: #define BOOST_CONCEPT_UNUSED_TYPEDEF /**/ Chris@101: #endif Chris@101: Chris@16: # define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \ Chris@16: typedef ::boost::concepts::detail::instantiate< \ Chris@16: &::boost::concepts::requirement_::failed> \ Chris@101: BOOST_PP_CAT(boost_concept_check,__LINE__) \ Chris@101: BOOST_CONCEPT_UNUSED_TYPEDEF Chris@16: Chris@16: }} Chris@16: Chris@16: #endif // BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP