Merged r53751, r41955, r47793, r47794, r47797, r62595 from trunk; fixes #865

[SVN r62596]
This commit is contained in:
Jeremiah Willcock
2010-06-08 19:31:13 +00:00
parent def441d02d
commit 570d5a6f92
8 changed files with 73 additions and 21 deletions

View File

@@ -250,7 +250,7 @@ bad_error_eg.cpp:8: instantiated from here
boost/concept_check.hpp: In destructor boost::LessThanComparable<TT>::~ boost/concept_check.hpp: In destructor boost::LessThanComparable<TT>::~
LessThanComparable() [with TT = std::complex<float>]: LessThanComparable() [with TT = std::complex<float>]:
boost/concept/detail/general.hpp:29: instantiated from static void boost:: 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> >] LessThanComparable<std::complex<float> >]
boost/concept/requires.hpp:30: instantiated from boost::_requires_<void boost/concept/requires.hpp:30: instantiated from boost::_requires_<void
(*)(boost::LessThanComparable<std::complex<float> >)> (*)(boost::LessThanComparable<std::complex<float> >)>

View File

@@ -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

5
include/boost/concept/detail/borland.hpp Executable file → Normal file
View File

@@ -5,8 +5,9 @@
# define BOOST_CONCEPT_DETAIL_BORLAND_DWA2006429_HPP # define BOOST_CONCEPT_DETAIL_BORLAND_DWA2006429_HPP
# include <boost/preprocessor/cat.hpp> # include <boost/preprocessor/cat.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
namespace boost { namespace concept { namespace boost { namespace concepts {
template <class ModelFnPtr> template <class ModelFnPtr>
struct require; struct require;
@@ -21,7 +22,7 @@ struct require<void(*)(Model)>
enum \ enum \
{ \ { \
BOOST_PP_CAT(boost_concept_check,__LINE__) = \ BOOST_PP_CAT(boost_concept_check,__LINE__) = \
boost::concept::require<ModelFnPtr>::instantiate \ boost::concepts::require<ModelFnPtr>::instantiate \
} }
}} // namespace boost::concept }} // namespace boost::concept

21
include/boost/concept/detail/general.hpp Executable file → Normal file
View File

@@ -5,6 +5,7 @@
# define BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP # define BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP
# include <boost/preprocessor/cat.hpp> # include <boost/preprocessor/cat.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
# ifdef BOOST_OLD_CONCEPT_SUPPORT # ifdef BOOST_OLD_CONCEPT_SUPPORT
# include <boost/concept/detail/has_constraints.hpp> # include <boost/concept/detail/has_constraints.hpp>
@@ -13,7 +14,7 @@
// This implementation works on Comeau and GCC, all the way back to // This implementation works on Comeau and GCC, all the way back to
// 2.95 // 2.95
namespace boost { namespace concept { namespace boost { namespace concepts {
template <class ModelFn> template <class ModelFn>
struct requirement_; struct requirement_;
@@ -29,6 +30,14 @@ struct requirement
static void failed() { ((Model*)0)->~Model(); } static void failed() { ((Model*)0)->~Model(); }
}; };
struct failed {};
template <class Model>
struct requirement<failed ************ Model::************>
{
static void failed() { ((Model*)0)->~Model(); }
};
# ifdef BOOST_OLD_CONCEPT_SUPPORT # ifdef BOOST_OLD_CONCEPT_SUPPORT
template <class Model> template <class Model>
@@ -40,9 +49,9 @@ struct constraint
template <class Model> template <class Model>
struct requirement_<void(*)(Model)> struct requirement_<void(*)(Model)>
: mpl::if_< : mpl::if_<
concept::not_satisfied<Model> concepts::not_satisfied<Model>
, constraint<Model> , constraint<Model>
, requirement<Model> , requirement<failed ************ Model::************>
>::type >::type
{}; {};
@@ -51,14 +60,14 @@ struct requirement_<void(*)(Model)>
// For GCC-2.x, these can't have exactly the same name // For GCC-2.x, these can't have exactly the same name
template <class Model> template <class Model>
struct requirement_<void(*)(Model)> struct requirement_<void(*)(Model)>
: requirement<Model> : requirement<failed ************ Model::************>
{}; {};
# endif # endif
# define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \ # define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \
typedef ::boost::concept::detail::instantiate< \ typedef ::boost::concepts::detail::instantiate< \
&::boost::concept::requirement_<ModelFnPtr>::failed> \ &::boost::concepts::requirement_<ModelFnPtr>::failed> \
BOOST_PP_CAT(boost_concept_check,__LINE__) BOOST_PP_CAT(boost_concept_check,__LINE__)
}} }}

View File

@@ -6,7 +6,9 @@
# include <boost/mpl/bool.hpp> # include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp> # include <boost/detail/workaround.hpp>
namespace boost { namespace concept { # include <boost/concept/detail/backward_compatibility.hpp>
namespace boost { namespace concepts {
namespace detail namespace detail
{ {
@@ -43,6 +45,6 @@ struct not_satisfied
typedef mpl::bool_<value> type; typedef mpl::bool_<value> type;
}; };
}} // namespace boost::concept::detail }} // namespace boost::concepts::detail
#endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP #endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP

30
include/boost/concept/detail/msvc.hpp Executable file → Normal file
View File

@@ -5,6 +5,7 @@
# define BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP # define BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
# include <boost/preprocessor/cat.hpp> # include <boost/preprocessor/cat.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
# ifdef BOOST_OLD_CONCEPT_SUPPORT # ifdef BOOST_OLD_CONCEPT_SUPPORT
# include <boost/concept/detail/has_constraints.hpp> # include <boost/concept/detail/has_constraints.hpp>
@@ -12,7 +13,8 @@
# endif # endif
namespace boost { namespace concept { namespace boost { namespace concepts {
template <class Model> template <class Model>
struct check struct check
@@ -23,6 +25,18 @@ struct check
} }
}; };
# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
struct failed {};
template <class Model>
struct check<failed ************ Model::************>
{
virtual void failed(Model* x)
{
x->~Model();
}
};
# endif
# ifdef BOOST_OLD_CONCEPT_SUPPORT # ifdef BOOST_OLD_CONCEPT_SUPPORT
namespace detail namespace detail
@@ -38,7 +52,11 @@ struct require
: mpl::if_c< : mpl::if_c<
not_satisfied<Model>::value not_satisfied<Model>::value
, detail::constraint , detail::constraint
# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
, check<Model> , check<Model>
# else
, check<failed ************ Model::************>
# endif
>::type >::type
{}; {};
@@ -46,7 +64,11 @@ struct require
template <class Model> template <class Model>
struct require struct require
: check<Model> # ifndef BOOST_NO_PARTIAL_SPECIALIZATION
: check<Model>
# else
: check<failed ************ Model::************>
# endif
{}; {};
# endif # endif
@@ -70,7 +92,7 @@ struct require<void(*)(Model)>
enum \ enum \
{ \ { \
BOOST_PP_CAT(boost_concept_check,__LINE__) = \ BOOST_PP_CAT(boost_concept_check,__LINE__) = \
sizeof(::boost::concept::require<ModelFnPtr>) \ sizeof(::boost::concepts::require<ModelFnPtr>) \
} }
# else // Not vc-7.1 # else // Not vc-7.1
@@ -83,7 +105,7 @@ require_(void(*)(Model));
enum \ enum \
{ \ { \
BOOST_PP_CAT(boost_concept_check,__LINE__) = \ BOOST_PP_CAT(boost_concept_check,__LINE__) = \
sizeof(::boost::concept::require_((ModelFnPtr)0)) \ sizeof(::boost::concepts::require_((ModelFnPtr)0)) \
} }
# endif # endif

9
include/boost/concept/usage.hpp Executable file → Normal file
View File

@@ -6,8 +6,9 @@
# include <boost/concept/assert.hpp> # include <boost/concept/assert.hpp>
# include <boost/detail/workaround.hpp> # include <boost/detail/workaround.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
namespace boost { namespace concept { namespace boost { namespace concepts {
# if BOOST_WORKAROUND(__GNUC__, == 2) # if BOOST_WORKAROUND(__GNUC__, == 2)
@@ -25,19 +26,19 @@ struct usage_requirements
# define BOOST_CONCEPT_USAGE(model) \ # define BOOST_CONCEPT_USAGE(model) \
model(); /* at least 2.96 and 3.4.3 both need this :( */ \ model(); /* at least 2.96 and 3.4.3 both need this :( */ \
BOOST_CONCEPT_ASSERT((boost::concept::usage_requirements<model>)); \ BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements<model>)); \
~model() ~model()
# else # else
# define BOOST_CONCEPT_USAGE(model) \ # define BOOST_CONCEPT_USAGE(model) \
BOOST_CONCEPT_ASSERT((boost::concept::usage_requirements<model>)); \ BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements<model>)); \
~model() ~model()
# endif # endif
# endif # endif
}} // namespace boost::concept }} // namespace boost::concepts
#endif // BOOST_CONCEPT_USAGE_DWA2006919_HPP #endif // BOOST_CONCEPT_USAGE_DWA2006919_HPP

View File

@@ -47,7 +47,8 @@ main()
function_requires< BackInsertionSequence<Vector> >(); function_requires< BackInsertionSequence<Vector> >();
#if !(defined(__GNUC__) && defined(BOOST_HIDE_EXPECTED_ERRORS)) #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 // old deque iterator missing n + iter operation
function_requires< Mutable_RandomAccessContainer<Deque> >(); function_requires< Mutable_RandomAccessContainer<Deque> >();
#endif #endif