1/*
2Copyright 2020 Glen Joseph Fernandes
3(glenjofe@gmail.com)
4
5Distributed 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/lightweight_test_trait.hpp>
10#include <boost/core/detail/is_same.hpp>
11
12template<class T>
13struct A1 {
14 typedef T value_type;
15 template<class>
16 struct rebind {
17 typedef A1<int> other;
18 };
19};
20
21template<class T>
22struct A2 {
23 typedef T value_type;
24};
25
26int main()
27{
28 BOOST_TEST_TRAIT_TRUE((boost::core::detail::is_same<A1<int>,
29 boost::allocator_rebind<A1<char>, bool>::type>));
30 BOOST_TEST_TRAIT_TRUE((boost::core::detail::is_same<A2<int>,
31 boost::allocator_rebind<A2<char>, int>::type>));
32 return boost::report_errors();
33}
34

source code of boost/libs/core/test/allocator_rebind_test.cpp