]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/type_traits/test/is_complex_test.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / type_traits / test / is_complex_test.cpp
CommitLineData
7c673cae
FG
1
2// (C) Copyright John Maddock 2007.
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_complex.hpp>
11#endif
11fdf7f2
TL
12#include "test.hpp"
13#include "check_integral_constant.hpp"
7c673cae
FG
14#include <iostream>
15
16struct bad_struct
17{
18 operator std::complex<double> ()const;
19};
20
21struct derived_complex : public std::complex<double>
22{
23};
24
25TT_TEST_BEGIN(is_complex)
26
27 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<int>::value, false);
28 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<double>::value, false);
29 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<float>::value, false);
30 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<bad_struct>::value, false);
31 //BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<derived_complex>::value, false);
32 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<std::complex<long double> >::value, true);
33 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<std::complex<double> >::value, true);
34 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<std::complex<float> >::value, true);
35 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<const std::complex<long double> >::value, true);
36 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<const std::complex<double> >::value, true);
37 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<const std::complex<float> >::value, true);
38 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<const volatile std::complex<long double> >::value, true);
39 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<const volatile std::complex<double> >::value, true);
40 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<const volatile std::complex<float> >::value, true);
41 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<volatile std::complex<long double> >::value, true);
42 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<volatile std::complex<double> >::value, true);
43 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_complex<volatile std::complex<float> >::value, true);
44
45TT_TEST_END
46
47
48
49
50
51
52
53
54