]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/test/udt_specialisations.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / type_traits / test / udt_specialisations.cpp
CommitLineData
7c673cae
FG
1
2// (C) Copyright John Maddock 2004.
3// Use, modification and distribution are subject to the
4// Boost Software License, Version 1.0. (See accompanying file
5// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7c673cae
FG
7#ifdef TEST_STD
8# include <type_traits>
9#else
10# include <boost/type_traits/is_pod.hpp>
11# include <boost/type_traits/is_class.hpp>
12# include <boost/type_traits/is_union.hpp>
13#endif
11fdf7f2
TL
14#include "test.hpp"
15#include "check_integral_constant.hpp"
7c673cae
FG
16
17struct my_pod{};
18struct my_union
19{
20 char c;
21 int i;
22};
23
24namespace tt
25{
26template<>
27struct is_pod<my_pod>
28 : public mpl::true_{};
29template<>
30struct is_pod<my_union>
31 : public mpl::true_{};
32template<>
33struct is_union<my_union>
34 : public mpl::true_{};
35template<>
36struct is_class<my_union>
37 : public mpl::false_{};
38}
39
40TT_TEST_BEGIN(is_pod)
41
42BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<my_pod>::value, true);
43BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<my_union>::value, true);
44BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<my_union>::value, true);
45BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<my_union>::value, false);
46
47TT_TEST_END
48