]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/util/compress_variant.cpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
4 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
6 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
8 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
9 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
11 // Use, modification and distribution is subject to the Boost Software License,
12 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
13 // http://www.boost.org/LICENSE_1_0.txt)
16 #include <boost/test/included/test_exec_monitor.hpp>
17 #include <boost/geometry/util/compress_variant.hpp>
18 #include <boost/mpl/assert.hpp>
19 #include <boost/mpl/equal.hpp>
20 #include <boost/mpl/vector.hpp>
21 #include <boost/type_traits/is_same.hpp>
22 #include <boost/variant/variant.hpp>
25 template <typename ExpectedTypes
, BOOST_VARIANT_ENUM_PARAMS(typename T
)>
26 void check_variant_types(boost::variant
<BOOST_VARIANT_ENUM_PARAMS(T
)>)
30 typename
boost::variant
<BOOST_VARIANT_ENUM_PARAMS(T
)>::types
,
36 template <typename Variant
, typename ExpectedTypes
>
37 void test_variant_result()
39 check_variant_types
<ExpectedTypes
>(typename
boost::geometry::compress_variant
<Variant
>::type());
42 template <typename Variant
, typename ExpectedType
>
43 void test_single_type_result()
47 typename
boost::geometry::compress_variant
<Variant
>::type
,
54 int test_main(int, char* [])
57 boost::variant
<int, float, double>,
58 boost::mpl::vector
<int, float, double>
62 boost::variant
<int, float, double, int, int, float, double, double, float>,
63 boost::mpl::vector
<int, double, float>
66 test_single_type_result
<
71 test_single_type_result
<
72 boost::variant
<double, double, double, double, double>,