2 // (C) Copyright John Maddock 2000.
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)
8 #include "check_integral_constant.hpp"
10 # include <type_traits>
12 # include <boost/type_traits/is_pointer.hpp>
15 TT_TEST_BEGIN(is_pointer
)
17 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<int>::value
, false);
18 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<int&>::value
, false);
19 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<int*>::value
, true);
20 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<const int*>::value
, true);
21 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<volatile int*>::value
, true);
22 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<non_pointer
*>::value
, true);
23 // these were false in previous versions (JM 20 Dec 2000):
24 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<int*const>::value
, true);
25 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<int*volatile>::value
, true);
26 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<int*const volatile>::value
, true);
28 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<non_pointer
>::value
, false);
29 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<int*&>::value
, false);
30 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<int(&)[2]>::value
, false);
31 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<int[2]>::value
, false);
32 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<char[sizeof(void*)]>::value
, false);
33 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<void>::value
, false);
35 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<f1
>::value
, true);
36 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<f2
>::value
, true);
37 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<f3
>::value
, true);
38 // Steve: was 'true', should be 'false', via 3.9.2p3
39 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<mf1
>::value
, false);
40 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<mf2
>::value
, false);
41 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<mf3
>::value
, false);
42 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<mf4
>::value
, false);
43 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<test_abc1
>::value
, false);
45 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<foo0_t
>::value
, false);
46 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<foo1_t
>::value
, false);
47 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<foo2_t
>::value
, false);
48 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<foo3_t
>::value
, false);
49 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<foo4_t
>::value
, false);
51 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pointer
<test_abc1
>::value
, false);