Revise allocator_access implementation

This commit is contained in:
Glen Fernandes
2020-05-25 15:00:18 -04:00
parent 65901249d5
commit 376aa7aa31
22 changed files with 562 additions and 582 deletions

View File

@@ -9,20 +9,26 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/is_same.hpp>
#include <boost/core/lightweight_test_trait.hpp>
template<class T>
struct A1 {
typedef char value_type;
};
struct A2 {
typedef char value_type;
typedef T value_type;
typedef int* pointer;
};
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
template<class T>
struct A2 {
typedef T value_type;
};
#endif
int main()
{
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<char*,
boost::allocator_pointer<A1>::type>));
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int*,
boost::allocator_pointer<A2>::type>));
boost::allocator_pointer<A1<char> >::type>));
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<int*,
boost::allocator_pointer<A2<int> >::type>));
#endif
return boost::report_errors();
}