]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/core/test/pointer_traits_element_type_test.cpp
2 Copyright 2017 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/core/pointer_traits.hpp>
9 #include <boost/core/is_same.hpp>
10 #include <boost/core/lightweight_test_trait.hpp>
15 template<class T1
, class T2
>
18 template<class T1
, class T2
, class T3
>
23 typedef bool element_type
;
26 template<class T1
, class T2
>
28 typedef bool element_type
;
31 template<class T1
, class T2
, class T3
>
33 typedef bool element_type
;
36 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
37 template<class T
, class... U
>
40 template<class T
, class... U
>
42 typedef bool element_type
;
48 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<int,
49 boost::pointer_traits
<int*>::element_type
>));
50 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<int,
51 boost::pointer_traits
<P1
<int> >::element_type
>));
52 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<int,
53 boost::pointer_traits
<P2
<int, char> >::element_type
>));
54 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<int,
55 boost::pointer_traits
<P3
<int, char, char> >::element_type
>));
56 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
57 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<int,
58 boost::pointer_traits
<P
<int, char, char, char> >::element_type
>));
60 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<bool,
61 boost::pointer_traits
<E1
<int> >::element_type
>));
62 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<bool,
63 boost::pointer_traits
<E2
<int, int> >::element_type
>));
64 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<bool,
65 boost::pointer_traits
<E3
<int, int, int> >::element_type
>));
66 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
67 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<bool,
68 boost::pointer_traits
<E
<int, int, int, int> >::element_type
>));
70 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<void,
71 boost::pointer_traits
<void*>::element_type
>));
72 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<void,
73 boost::pointer_traits
<P1
<void> >::element_type
>));
74 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<bool,
75 boost::pointer_traits
<E1
<void> >::element_type
>));
76 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<const int,
77 boost::pointer_traits
<const int*>::element_type
>));
78 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<const int,
79 boost::pointer_traits
<P1
<const int> >::element_type
>));
80 BOOST_TEST_TRAIT_TRUE((boost::core::is_same
<bool,
81 boost::pointer_traits
<E1
<const int> >::element_type
>));
82 return boost::report_errors();