diff --git a/concept_check.htm b/concept_check.htm index 9ddcf8d..1dd72c2 100644 --- a/concept_check.htm +++ b/concept_check.htm @@ -250,7 +250,7 @@ bad_error_eg.cpp:8: instantiated from here boost/concept_check.hpp: In destructor ‘boost::LessThanComparable<TT>::~ LessThanComparable() [with TT = std::complex<float>]’: boost/concept/detail/general.hpp:29: instantiated from ‘static void boost:: - concept::requirement<Model>::failed() [with Model = boost:: + concepts::requirement<Model>::failed() [with Model = boost:: LessThanComparable<std::complex<float> >]’ boost/concept/requires.hpp:30: instantiated from ‘boost::_requires_<void (*)(boost::LessThanComparable<std::complex<float> >)>’ diff --git a/include/boost/concept/detail/backward_compatibility.hpp b/include/boost/concept/detail/backward_compatibility.hpp new file mode 100644 index 0000000..88d5921 --- /dev/null +++ b/include/boost/concept/detail/backward_compatibility.hpp @@ -0,0 +1,16 @@ +// Copyright David Abrahams 2009. 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_BACKWARD_COMPATIBILITY_DWA200968_HPP +# define BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP + +namespace boost +{ + namespace concepts {} + +# if !defined(BOOST_NO_CONCEPTS) && !defined(BOOST_CONCEPT_NO_BACKWARD_KEYWORD) + namespace concept = concepts; +# endif +} // namespace boost::concept + +#endif // BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP diff --git a/include/boost/concept/detail/borland.hpp b/include/boost/concept/detail/borland.hpp old mode 100755 new mode 100644 index 59fec55..300d5d4 --- a/include/boost/concept/detail/borland.hpp +++ b/include/boost/concept/detail/borland.hpp @@ -5,8 +5,9 @@ # define BOOST_CONCEPT_DETAIL_BORLAND_DWA2006429_HPP # include +# include -namespace boost { namespace concept { +namespace boost { namespace concepts { template struct require; @@ -21,7 +22,7 @@ struct require enum \ { \ BOOST_PP_CAT(boost_concept_check,__LINE__) = \ - boost::concept::require::instantiate \ + boost::concepts::require::instantiate \ } }} // namespace boost::concept diff --git a/include/boost/concept/detail/general.hpp b/include/boost/concept/detail/general.hpp old mode 100755 new mode 100644 index f36f9c4..e3014c1 --- a/include/boost/concept/detail/general.hpp +++ b/include/boost/concept/detail/general.hpp @@ -5,6 +5,7 @@ # define BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP # include +# include # ifdef BOOST_OLD_CONCEPT_SUPPORT # include @@ -13,7 +14,7 @@ // This implementation works on Comeau and GCC, all the way back to // 2.95 -namespace boost { namespace concept { +namespace boost { namespace concepts { template struct requirement_; @@ -29,6 +30,14 @@ struct requirement static void failed() { ((Model*)0)->~Model(); } }; +struct failed {}; + +template +struct requirement +{ + static void failed() { ((Model*)0)->~Model(); } +}; + # ifdef BOOST_OLD_CONCEPT_SUPPORT template @@ -40,9 +49,9 @@ struct constraint template struct requirement_ : mpl::if_< - concept::not_satisfied + concepts::not_satisfied , constraint - , requirement + , requirement >::type {}; @@ -51,14 +60,14 @@ struct requirement_ // For GCC-2.x, these can't have exactly the same name template struct requirement_ - : requirement + : requirement {}; # endif # define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \ - typedef ::boost::concept::detail::instantiate< \ - &::boost::concept::requirement_::failed> \ + typedef ::boost::concepts::detail::instantiate< \ + &::boost::concepts::requirement_::failed> \ BOOST_PP_CAT(boost_concept_check,__LINE__) }} diff --git a/include/boost/concept/detail/has_constraints.hpp b/include/boost/concept/detail/has_constraints.hpp index 9191181..a309db3 100644 --- a/include/boost/concept/detail/has_constraints.hpp +++ b/include/boost/concept/detail/has_constraints.hpp @@ -6,7 +6,9 @@ # include # include -namespace boost { namespace concept { +# include + +namespace boost { namespace concepts { namespace detail { @@ -43,6 +45,6 @@ struct not_satisfied typedef mpl::bool_ type; }; -}} // namespace boost::concept::detail +}} // namespace boost::concepts::detail #endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP diff --git a/include/boost/concept/detail/msvc.hpp b/include/boost/concept/detail/msvc.hpp old mode 100755 new mode 100644 index 3aadb79..9fbd250 --- a/include/boost/concept/detail/msvc.hpp +++ b/include/boost/concept/detail/msvc.hpp @@ -5,6 +5,7 @@ # define BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP # include +# include # ifdef BOOST_OLD_CONCEPT_SUPPORT # include @@ -12,7 +13,8 @@ # endif -namespace boost { namespace concept { +namespace boost { namespace concepts { + template struct check @@ -22,7 +24,19 @@ struct check x->~Model(); } }; - + +# ifndef BOOST_NO_PARTIAL_SPECIALIZATION +struct failed {}; +template +struct check +{ + virtual void failed(Model* x) + { + x->~Model(); + } +}; +# endif + # ifdef BOOST_OLD_CONCEPT_SUPPORT namespace detail @@ -38,7 +52,11 @@ struct require : mpl::if_c< not_satisfied::value , detail::constraint +# ifndef BOOST_NO_PARTIAL_SPECIALIZATION , check +# else + , check +# endif >::type {}; @@ -46,7 +64,11 @@ struct require template struct require - : check +# ifndef BOOST_NO_PARTIAL_SPECIALIZATION + : check +# else + : check +# endif {}; # endif @@ -70,7 +92,7 @@ struct require enum \ { \ BOOST_PP_CAT(boost_concept_check,__LINE__) = \ - sizeof(::boost::concept::require) \ + sizeof(::boost::concepts::require) \ } # else // Not vc-7.1 @@ -83,7 +105,7 @@ require_(void(*)(Model)); enum \ { \ BOOST_PP_CAT(boost_concept_check,__LINE__) = \ - sizeof(::boost::concept::require_((ModelFnPtr)0)) \ + sizeof(::boost::concepts::require_((ModelFnPtr)0)) \ } # endif diff --git a/include/boost/concept/usage.hpp b/include/boost/concept/usage.hpp old mode 100755 new mode 100644 index 9af8ca3..21547c3 --- a/include/boost/concept/usage.hpp +++ b/include/boost/concept/usage.hpp @@ -6,8 +6,9 @@ # include # include +# include -namespace boost { namespace concept { +namespace boost { namespace concepts { # if BOOST_WORKAROUND(__GNUC__, == 2) @@ -25,19 +26,19 @@ struct usage_requirements # define BOOST_CONCEPT_USAGE(model) \ model(); /* at least 2.96 and 3.4.3 both need this :( */ \ - BOOST_CONCEPT_ASSERT((boost::concept::usage_requirements)); \ + BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements)); \ ~model() # else # define BOOST_CONCEPT_USAGE(model) \ - BOOST_CONCEPT_ASSERT((boost::concept::usage_requirements)); \ + BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements)); \ ~model() # endif # endif -}} // namespace boost::concept +}} // namespace boost::concepts #endif // BOOST_CONCEPT_USAGE_DWA2006919_HPP diff --git a/stl_concept_check.cpp b/stl_concept_check.cpp index 8ec6f96..d336de1 100644 --- a/stl_concept_check.cpp +++ b/stl_concept_check.cpp @@ -47,7 +47,8 @@ main() function_requires< BackInsertionSequence >(); #if !(defined(__GNUC__) && defined(BOOST_HIDE_EXPECTED_ERRORS)) -#if !(defined(__sgi) && defined(BOOST_HIDE_EXPECTED_ERRORS)) +#if !((defined(__sgi) || (defined(__DECCXX) && defined(_RWSTD_VER) && _RWSTD_VER <= 0x0203)) \ + && defined(BOOST_HIDE_EXPECTED_ERRORS)) // old deque iterator missing n + iter operation function_requires< Mutable_RandomAccessContainer >(); #endif