2 Copyright 2014 Glen Joseph Fernandes
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
8 #include <boost/align/alignment_of.hpp>
9 #include <boost/core/lightweight_test.hpp>
10 #include <boost/config.hpp>
14 struct remove_reference
{
19 struct remove_reference
<T
&> {
23 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
25 struct remove_reference
<T
&&> {
31 struct remove_all_extents
{
36 struct remove_all_extents
<T
[]> {
37 typedef typename remove_all_extents
<T
>::type type
;
40 template<class T
, std::size_t N
>
41 struct remove_all_extents
<T
[N
]> {
42 typedef typename remove_all_extents
<T
>::type type
;
51 struct remove_cv
<const T
> {
56 struct remove_cv
<volatile T
> {
61 struct remove_cv
<const volatile T
> {
68 typename remove_cv
<typename remove_all_extents
<typename
69 remove_reference
<T
>::type
>::type
>::type object
;
76 N
= boost::alignment::alignment_of
<T
>::value
78 BOOST_TEST(offsetof(offset_value
<T
>, object
) == N
);
87 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
96 test_reference
<T
[2]>();
104 test_array
<const T
>();
105 test_array
<volatile T
>();
106 test_array
<const volatile T
>();
123 test_cv
<Struct
<T
> >();
124 test_cv
<Union
<T
> >();
132 test
<unsigned char>();
135 #if !defined(BOOST_NO_CXX11_CHAR16_T)
139 #if !defined(BOOST_NO_CXX11_CHAR32_T)
144 test
<unsigned short>();
146 test
<unsigned int>();
148 test
<unsigned long>();
150 #if !defined(BOOST_NO_LONG_LONG)
152 test
<unsigned long long>();
156 void test_floating_point()
163 void test_nullptr_t()
165 #if !defined(BOOST_NO_CXX11_NULLPTR) && \
166 !defined(BOOST_NO_CXX11_DECLTYPE)
167 test
<decltype(nullptr)>();
182 void test_member_pointer()
211 test_floating_point();
214 test_member_pointer();
218 return boost::report_errors();