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 typedef int* const_pointer;
16 typedef int* const_void_pointer;
17 template<class U>
18 struct rebind {
19 typedef A1<U> other;
20 };
21};
22
23template<class T>
24struct A2 {
25 typedef T value_type;
26};
27
28int main()
29{
30 BOOST_TEST_TRAIT_TRUE((boost::core::detail::is_same<int*,
31 boost::allocator_const_void_pointer<A1<char> >::type>));
32 BOOST_TEST_TRAIT_TRUE((boost::core::detail::is_same<const void*,
33 boost::allocator_const_void_pointer<A2<int> >::type>));
34 return boost::report_errors();
35}
36

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