From ec1d5268626d14912cfa8f5dc9b981973ba5c104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20M=2E=20L=C3=B3pez=20Mu=C3=B1oz?= Date: Wed, 9 Jun 2004 13:58:56 +0000 Subject: [PATCH] stricter check in is_partial_std_allocator [SVN r23067] --- include/boost/detail/allocator_utilities.hpp | 74 ++++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/include/boost/detail/allocator_utilities.hpp b/include/boost/detail/allocator_utilities.hpp index bf416a0..e98657e 100644 --- a/include/boost/detail/allocator_utilities.hpp +++ b/include/boost/detail/allocator_utilities.hpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -30,42 +29,6 @@ namespace detail{ namespace allocator{ -/* Detects whether a given allocator belongs to a defective stdlib not - * having the required member templates. - * Note that it does not suffice to check the Boost.Config stdlib - * macros, as the user might have passed a custom, compliant allocator. - * The checks also considers partial_std_allocator_wrapper to be - * a standard defective allocator. - */ - -#if defined(BOOST_NO_STD_ALLOCATOR)&&\ - (defined(BOOST_HAS_PARTIAL_STD_ALLOCATOR)||defined(BOOST_DINKUMWARE_STDLIB)) - -template -struct is_partial_std_allocator -{ - BOOST_STATIC_CONSTANT(bool, - value= - (is_same< - std::allocator, - Allocator - >::value)|| - (is_base_and_derived< - std::allocator, - Allocator - >::value)); -}; - -#else - -template -struct is_partial_std_allocator -{ - BOOST_STATIC_CONSTANT(bool,value=false); -}; - -#endif - /* partial_std_allocator_wrapper inherits the functionality of a std * allocator while providing a templatized ctor. */ @@ -93,6 +56,43 @@ public: }; +/* Detects whether a given allocator belongs to a defective stdlib not + * having the required member templates. + * Note that it does not suffice to check the Boost.Config stdlib + * macros, as the user might have passed a custom, compliant allocator. + * The checks also considers partial_std_allocator_wrapper to be + * a standard defective allocator. + */ + +#if defined(BOOST_NO_STD_ALLOCATOR)&&\ + (defined(BOOST_HAS_PARTIAL_STD_ALLOCATOR)||defined(BOOST_DINKUMWARE_STDLIB)) + +template +struct is_partial_std_allocator +{ + BOOST_STATIC_CONSTANT(bool, + value= + (is_same< + std::allocator, + Allocator + >::value)|| + (is_same< + partial_std_allocator_wrapper< + BOOST_DEDUCED_TYPENAME Allocator::value_type>, + Allocator + >::value)); +}; + +#else + +template +struct is_partial_std_allocator +{ + BOOST_STATIC_CONSTANT(bool,value=false); +}; + +#endif + /* rebind operations for defective std allocators */ template