forked from boostorg/core
Revise allocator_access implementation
This commit is contained in:
@@ -9,22 +9,29 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#include <boost/core/is_same.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
|
||||
template<class, class, class>
|
||||
struct A1 { };
|
||||
|
||||
template<class, class U, class V>
|
||||
struct A2 {
|
||||
template<class T>
|
||||
template<class T>
|
||||
struct A1 {
|
||||
typedef T value_type;
|
||||
template<class>
|
||||
struct rebind {
|
||||
typedef A1<T, U, V> other;
|
||||
typedef A1<int> other;
|
||||
};
|
||||
};
|
||||
|
||||
#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<A1<bool, int, float>,
|
||||
boost::allocator_rebind<A1<char, int, float>, bool>::type>));
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<A1<bool, int, float>,
|
||||
boost::allocator_rebind<A2<char, int, float>, bool>::type>));
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<A1<int>,
|
||||
boost::allocator_rebind<A1<char>, bool>::type>));
|
||||
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
BOOST_TEST_TRAIT_TRUE((boost::core::is_same<A2<int>,
|
||||
boost::allocator_rebind<A2<char>, int>::type>));
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Reference in New Issue
Block a user