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