forked from boostorg/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathallocator_is_always_equal_test.cpp
More file actions
46 lines (40 loc) · 1.02 KB
/
allocator_is_always_equal_test.cpp
File metadata and controls
46 lines (40 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Copyright 2020 Glen Joseph Fernandes
(glenjofe@gmail.com)
Distributed under the Boost Software License, Version 1.0.
(http://www.boost.org/LICENSE_1_0.txt)
*/
#include <boost/core/allocator_access.hpp>
#include <boost/core/lightweight_test_trait.hpp>
template<class T>
struct A1 {
typedef T value_type;
int value;
};
template<class T>
struct A2 {
typedef T value_type;
};
template<class T>
struct A3 {
typedef T value_type;
struct is_always_equal {
static const bool value = false;
};
};
template<class T>
struct A4 {
typedef T value_type;
struct is_always_equal {
static const bool value = true;
};
int value;
};
int main()
{
BOOST_TEST_TRAIT_FALSE((boost::allocator_is_always_equal<A1<int> >::type));
BOOST_TEST_TRAIT_TRUE((boost::allocator_is_always_equal<A2<int> >::type));
BOOST_TEST_TRAIT_FALSE((boost::allocator_is_always_equal<A3<int> >::type));
BOOST_TEST_TRAIT_TRUE((boost::allocator_is_always_equal<A4<int> >::type));
return boost::report_errors();
}