]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/core/test/allocator_is_always_equal_test.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / core / test / allocator_is_always_equal_test.cpp
CommitLineData
20effc67
TL
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/is_same.hpp>
10#include <boost/core/lightweight_test_trait.hpp>
11
12template<class T>
13struct A1 {
14 typedef T value_type;
15 int value;
16};
17
20effc67
TL
18template<class T>
19struct A2 {
20 typedef T value_type;
21};
22
23template<class T>
24struct A3 {
25 typedef T value_type;
1e59de90
TL
26 struct is_always_equal {
27 static const bool value = false;
28 };
20effc67
TL
29};
30
31template<class T>
32struct 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
40int 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}