1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
/*
Copyright 2020 Glen Joseph Fernandes
(glenjofe@gmail.com)
Distributed under the Boost Software License, Version 1.0.
(http://www.boost.org/LICENSE_1_0.txt)
*/
#include <boost/core/allocator_access.hpp>
#include <boost/core/lightweight_test_trait.hpp>
#include <boost/core/detail/is_same.hpp>
template<class T>
struct A1 {
typedef T value_type;
typedef int* pointer;
};
template<class T>
struct A2 {
typedef T value_type;
};
int main()
{
BOOST_TEST_TRAIT_TRUE((boost::core::detail::is_same<int*,
boost::allocator_pointer<A1<char> >::type>));
BOOST_TEST_TRAIT_TRUE((boost::core::detail::is_same<int*,
boost::allocator_pointer<A2<int> >::type>));
return boost::report_errors();
}
|