]>
Commit | Line | Data |
---|---|---|
20effc67 TL |
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 | int value; | |
16 | }; | |
17 | ||
20effc67 TL |
18 | template<class T> |
19 | struct A2 { | |
20 | typedef T value_type; | |
21 | }; | |
22 | ||
23 | template<class T> | |
24 | struct A3 { | |
25 | typedef T value_type; | |
1e59de90 TL |
26 | struct is_always_equal { |
27 | static const bool value = false; | |
28 | }; | |
20effc67 TL |
29 | }; |
30 | ||
31 | template<class T> | |
32 | struct A4 { | |
33 | typedef T value_type; | |
1e59de90 TL |
34 | struct is_always_equal { |
35 | static const bool value = true; | |
36 | }; | |
20effc67 TL |
37 | int value; |
38 | }; | |
20effc67 TL |
39 | |
40 | int main() | |
41 | { | |
42 | BOOST_TEST_TRAIT_FALSE((boost::allocator_is_always_equal<A1<int> >::type)); | |
20effc67 TL |
43 | BOOST_TEST_TRAIT_TRUE((boost::allocator_is_always_equal<A2<int> >::type)); |
44 | BOOST_TEST_TRAIT_FALSE((boost::allocator_is_always_equal<A3<int> >::type)); | |
45 | BOOST_TEST_TRAIT_TRUE((boost::allocator_is_always_equal<A4<int> >::type)); | |
20effc67 TL |
46 | return boost::report_errors(); |
47 | } |