// Copyright David Abrahams 2006. Distributed under the Boost // Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP # define BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP # include # include # include # ifdef BOOST_OLD_CONCEPT_SUPPORT # include # include # endif // This implementation works on Comeau and GCC, all the way back to // 2.95 namespace boost { namespace concepts { template struct requirement_; namespace detail { template struct instantiate {}; } template struct requirement { # if defined(BOOST_GCC) && (BOOST_GCC >= 110000) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wnonnull" # endif static void failed() { ((Model*)0)->~Model(); } # if defined(BOOST_GCC) && (BOOST_GCC >= 110000) # pragma GCC diagnostic pop # endif }; struct failed {}; template struct requirement { # if defined(BOOST_GCC) && (BOOST_GCC >= 110000) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wnonnull" # endif static void failed() { ((Model*)0)->~Model(); } # if defined(BOOST_GCC) && (BOOST_GCC >= 110000) # pragma GCC diagnostic pop # endif }; # ifdef BOOST_OLD_CONCEPT_SUPPORT template struct constraint { # if defined(BOOST_GCC) && (BOOST_GCC >= 110000) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wnonnull" # endif static void failed() { ((Model*)0)->constraints(); } # if defined(BOOST_GCC) && (BOOST_GCC >= 110000) # pragma GCC diagnostic pop # endif }; template struct requirement_ : boost::conditional< concepts::not_satisfied::value , constraint , requirement >::type {}; # else // For GCC-2.x, these can't have exactly the same name template struct requirement_ : requirement {}; # endif # define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \ typedef ::boost::concepts::detail::instantiate< \ &::boost::concepts::requirement_::failed> \ BOOST_PP_CAT(boost_concept_check,__LINE__) \ BOOST_ATTRIBUTE_UNUSED }} #endif // BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP