]>
Commit | Line | Data |
---|---|---|
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 | |
17 | struct my_pod{}; | |
18 | struct my_union | |
19 | { | |
20 | char c; | |
21 | int i; | |
22 | }; | |
23 | ||
24 | namespace tt | |
25 | { | |
26 | template<> | |
27 | struct is_pod<my_pod> | |
28 | : public mpl::true_{}; | |
29 | template<> | |
30 | struct is_pod<my_union> | |
31 | : public mpl::true_{}; | |
32 | template<> | |
33 | struct is_union<my_union> | |
34 | : public mpl::true_{}; | |
35 | template<> | |
36 | struct is_class<my_union> | |
37 | : public mpl::false_{}; | |
38 | } | |
39 | ||
40 | TT_TEST_BEGIN(is_pod) | |
41 | ||
42 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<my_pod>::value, true); | |
43 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<my_union>::value, true); | |
44 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_union<my_union>::value, true); | |
45 | BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_class<my_union>::value, false); | |
46 | ||
47 | TT_TEST_END | |
48 |