Remove dependency on Boost.TypeTraits.

This commit is contained in:
Tinko Sebastian Bartels
2026-04-25 13:11:51 +08:00
committed by Tinko Sebastian Bartels
parent 3d2d3734e0
commit 81684e85a5
21 changed files with 54 additions and 42 deletions
-1
View File
@@ -39,7 +39,6 @@ target_link_libraries(boost_geometry
Boost::throw_exception Boost::throw_exception
Boost::tokenizer Boost::tokenizer
Boost::tuple Boost::tuple
Boost::type_traits
Boost::utility Boost::utility
Boost::variant Boost::variant
) )
-1
View File
@@ -38,7 +38,6 @@ constant boost_dependencies :
/boost/throw_exception//boost_throw_exception /boost/throw_exception//boost_throw_exception
/boost/tokenizer//boost_tokenizer /boost/tokenizer//boost_tokenizer
/boost/tuple//boost_tuple /boost/tuple//boost_tuple
/boost/type_traits//boost_type_traits
/boost/variant//boost_variant /boost/variant//boost_variant
/boost/variant2//boost_variant2 ; /boost/variant2//boost_variant2 ;
@@ -14,10 +14,10 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <type_traits>
#include <boost/mpl/for_each.hpp> #include <boost/mpl/for_each.hpp>
#include <boost/mpl/vector.hpp> #include <boost/mpl/vector.hpp>
#include <boost/type_traits/is_base_of.hpp>
#define BOOST_GEOMETRY_IMPLEMENTATION_STATUS_BUILD true #define BOOST_GEOMETRY_IMPLEMENTATION_STATUS_BUILD true
@@ -112,7 +112,7 @@ struct do_unary_test
void operator()() void operator()()
{ {
if (boost::is_base_of<boost::geometry::nyi::not_implemented_tag, Dispatcher<G> >::type::value) if (std::is_base_of<boost::geometry::nyi::not_implemented_tag, Dispatcher<G> >::type::value)
{ {
m_outputter.nyi(); m_outputter.nyi();
} }
@@ -134,7 +134,7 @@ struct do_binary_test
template <typename G1> template <typename G1>
void operator()(G1) void operator()(G1)
{ {
if (boost::is_base_of<boost::geometry::nyi::not_implemented_tag, Dispatcher<G1, G2> >::type::value) if (std::is_base_of<boost::geometry::nyi::not_implemented_tag, Dispatcher<G1, G2> >::type::value)
{ {
m_outputter.nyi(); m_outputter.nyi();
} }
+2 -1
View File
@@ -12,6 +12,7 @@
#include <iostream> #include <iostream>
#include <typeinfo> #include <typeinfo>
#include <type_traits>
#include <boost/geometry.hpp> #include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/polygon.hpp>
@@ -36,7 +37,7 @@ int main()
std::cout std::cout
<< std::boolalpha << std::boolalpha
<< boost::is_same<ring_type, int_ring_type>::value << std::is_same<ring_type, int_ring_type>::value
<< std::endl; << std::endl;
return 0; return 0;
+2 -1
View File
@@ -15,6 +15,7 @@ Also shows the related ring_type and interior_type.
*/ */
#include <iostream> #include <iostream>
#include <type_traits>
#include <boost/geometry.hpp> #include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp> #include <boost/geometry/geometries/polygon.hpp>
@@ -59,7 +60,7 @@ int main()
std::cout std::cout
<< std::boolalpha << std::boolalpha
<< boost::is_same<ring_type, int_ring_type>::value << std::is_same<ring_type, int_ring_type>::value
<< std::endl; << std::endl;
return 0; return 0;
+3 -2
View File
@@ -11,6 +11,7 @@
// Custom polygon example // Custom polygon example
#include <iostream> #include <iostream>
#include <type_traits>
#include <boost/assert.hpp> #include <boost/assert.hpp>
@@ -74,7 +75,7 @@ struct custom_iterator : public boost::iterator_facade
boost::random_access_traversal_tag, boost::random_access_traversal_tag,
typename boost::mpl::if_ typename boost::mpl::if_
< <
boost::is_const<MyPolygon>, std::is_const<MyPolygon>,
my_point const, my_point const,
my_point my_point
>::type& >::type&
@@ -101,7 +102,7 @@ struct custom_iterator : public boost::iterator_facade
typedef typename boost::mpl::if_ typedef typename boost::mpl::if_
< <
boost::is_const<MyPolygon>, std::is_const<MyPolygon>,
my_point const, my_point const,
my_point my_point
>::type my_point_type; >::type my_point_type;
@@ -10,6 +10,8 @@
#define BOOST_GEOMETRY_EXT_GIS_IO_SHAPELIB_SHAPE_CREATOR_HPP #define BOOST_GEOMETRY_EXT_GIS_IO_SHAPELIB_SHAPE_CREATOR_HPP
#include <fstream> #include <fstream>
#include <type_traits>
#include "shapefil.h" #include "shapefil.h"
#include <boost/geometry/io/wkt/wkt.hpp> #include <boost/geometry/io/wkt/wkt.hpp>
@@ -34,8 +34,6 @@
#include <boost/mpl/pop_front.hpp> #include <boost/mpl/pop_front.hpp>
#include <boost/mpl/size.hpp> #include <boost/mpl/size.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/geometry/core/access.hpp> #include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp> #include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/coordinate_system.hpp> #include <boost/geometry/core/coordinate_system.hpp>
@@ -57,7 +55,7 @@ struct all_same :
bool, bool,
boost::mpl::count_if< boost::mpl::count_if<
Sequence, Sequence,
boost::is_same< std::is_same<
typename boost::mpl::front<Sequence>::type, typename boost::mpl::front<Sequence>::type,
boost::mpl::_ boost::mpl::_
> >
@@ -18,6 +18,8 @@
// boost::polygon::polygon_with_holes_data -> boost::geometry::polygon // boost::polygon::polygon_with_holes_data -> boost::geometry::polygon
// pair{begin_points, end_points} -> ring_proxy // pair{begin_points, end_points} -> ring_proxy
#include <type_traits>
#include <boost/polygon/polygon.hpp> #include <boost/polygon/polygon.hpp>
#include <boost/range/const_iterator.hpp> #include <boost/range/const_iterator.hpp>
#include <boost/range/mutable_iterator.hpp> #include <boost/range/mutable_iterator.hpp>
@@ -80,15 +82,15 @@ class ring_proxy
public : public :
typedef typename boost::polygon::polygon_traits typedef typename boost::polygon::polygon_traits
< <
typename boost::remove_const<Polygon>::type typename std::remove_const<Polygon>::type
>::iterator_type iterator_type; >::iterator_type iterator_type;
typedef typename boost::polygon::polygon_with_holes_traits typedef typename boost::polygon::polygon_with_holes_traits
< <
typename boost::remove_const<Polygon>::type typename std::remove_const<Polygon>::type
>::iterator_holes_type hole_iterator_type; >::iterator_holes_type hole_iterator_type;
static const bool is_mutable = !boost::is_const<Polygon>::type::value; static const bool is_mutable = !std::is_const<Polygon>::value;
inline ring_proxy(Polygon& p) inline ring_proxy(Polygon& p)
: m_polygon_pointer(&p) : m_polygon_pointer(&p)
@@ -16,9 +16,6 @@
#include <memory> #include <memory>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/type_traits/aligned_storage.hpp>
#include <boost/serialization/serialization.hpp> #include <boost/serialization/serialization.hpp>
#include <boost/serialization/split_member.hpp> #include <boost/serialization/split_member.hpp>
#include <boost/serialization/version.hpp> #include <boost/serialization/version.hpp>
@@ -67,10 +64,10 @@ public:
} }
T * address() T * address()
{ {
return static_cast<T*>(m_storage.address()); return reinterpret_cast<T*>(&m_storage);
} }
private: private:
boost::aligned_storage<sizeof(T), boost::alignment_of<T>::value> m_storage; alignas(T) unsigned char m_storage[sizeof(T)];
}; };
// TODO - save and load item_version? see: collections_load_imp and collections_save_imp // TODO - save and load item_version? see: collections_load_imp and collections_save_imp
@@ -11,10 +11,11 @@
#ifndef BOOST_GEOMETRY_SRS_PROJECTIONS_STR_CAST_HPP #ifndef BOOST_GEOMETRY_SRS_PROJECTIONS_STR_CAST_HPP
#define BOOST_GEOMETRY_SRS_PROJECTIONS_STR_CAST_HPP #define BOOST_GEOMETRY_SRS_PROJECTIONS_STR_CAST_HPP
#include <type_traits>
#include <boost/config.hpp> #include <boost/config.hpp>
#include <boost/geometry/core/exception.hpp> #include <boost/geometry/core/exception.hpp>
#include <boost/throw_exception.hpp> #include <boost/throw_exception.hpp>
#include <boost/type_traits/remove_cv.hpp>
namespace boost { namespace geometry namespace boost { namespace geometry
{ {
@@ -116,7 +117,7 @@ struct str_cast_traits_generic
char * str_end = (char*)(void*)str; char * str_end = (char*)(void*)str;
T res = str_cast_traits_strtox T res = str_cast_traits_strtox
< <
typename boost::remove_cv<T>::type typename std::remove_cv<T>::type
>::apply(str, &str_end); >::apply(str, &str_end);
if (str_end == str) if (str_end == str)
{ {
+7 -6
View File
@@ -8,6 +8,7 @@
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
#include <memory> #include <memory>
#include <type_traits>
#include <rtree/test_rtree.hpp> #include <rtree/test_rtree.hpp>
@@ -27,16 +28,16 @@ void check_convertible_to_value(Rtree const& rt, Convertible const& conv)
{ {
static const bool static const bool
is_conv_to_indexable is_conv_to_indexable
= boost::is_convertible<Convertible, typename Rtree::indexable_type>::value; = std::is_convertible<Convertible, typename Rtree::indexable_type>::value;
static const bool static const bool
is_conv_to_value is_conv_to_value
= boost::is_convertible<Convertible, typename Rtree::value_type>::value; = std::is_convertible<Convertible, typename Rtree::value_type>::value;
static const bool static const bool
is_same_as_indexable is_same_as_indexable
= boost::is_same<Convertible, typename Rtree::indexable_type>::value; = std::is_same<Convertible, typename Rtree::indexable_type>::value;
static const bool static const bool
is_same_as_value is_same_as_value
= boost::is_same<Convertible, typename Rtree::value_type>::value; = std::is_same<Convertible, typename Rtree::value_type>::value;
BOOST_CHECK_EQUAL(is_same_as_indexable, false); BOOST_CHECK_EQUAL(is_same_as_indexable, false);
BOOST_CHECK_EQUAL(is_same_as_value, false); BOOST_CHECK_EQUAL(is_same_as_value, false);
@@ -52,7 +53,7 @@ void test_pair()
{ {
typedef std::pair<Box, std::size_t> Value; typedef std::pair<Box, std::size_t> Value;
typename boost::remove_const<Box>::type box; typename std::remove_const<Box>::type box;
bg::assign_zero(box); bg::assign_zero(box);
Value val(box, 0); Value val(box, 0);
@@ -93,7 +94,7 @@ void test_pair_geom_ptr()
typedef std::pair<Box, polygon_t*> Value; typedef std::pair<Box, polygon_t*> Value;
typename boost::remove_const<Box>::type box; typename std::remove_const<Box>::type box;
bg::assign_zero(box); bg::assign_zero(box);
polygon_t poly; polygon_t poly;
+2 -1
View File
@@ -18,6 +18,7 @@
#include <limits> #include <limits>
#include <iostream> #include <iostream>
#include <type_traits>
#include <boost/test/included/unit_test.hpp> #include <boost/test/included/unit_test.hpp>
@@ -1294,7 +1295,7 @@ BOOST_AUTO_TEST_CASE( test_is_valid_multipolygon )
template <typename CoordinateType, typename Geometry> template <typename CoordinateType, typename Geometry>
inline void check_one(Geometry const& geometry) inline void check_one(Geometry const& geometry)
{ {
bool const is_fp = boost::is_floating_point<CoordinateType>::value; bool const is_fp = std::is_floating_point<CoordinateType>::value;
bg::validity_failure_type failure; bg::validity_failure_type failure;
bool validity = bg::is_valid(geometry, failure); bool validity = bg::is_valid(geometry, failure);
@@ -17,6 +17,8 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
#include <type_traits>
#include "test_get_turns.hpp" #include "test_get_turns.hpp"
#include <boost/geometry/geometries/geometries.hpp> #include <boost/geometry/geometries/geometries.hpp>
@@ -262,7 +264,7 @@ void test_all()
"LINESTRING(-5 -4,3 0,7 -4,2 -1)", "LINESTRING(-5 -4,3 0,7 -4,2 -1)",
expected("tii++")("mxu==")("miu==")("mui=+")); expected("tii++")("mxu==")("miu==")("mui=+"));
if ( BOOST_GEOMETRY_CONDITION((boost::is_same<T, double>::value)) ) if ( BOOST_GEOMETRY_CONDITION((std::is_same<T, double>::value)) )
{ {
// BUG - the operations are correct but IP coordinates are wrong // BUG - the operations are correct but IP coordinates are wrong
// ok now also the 3rd turn is wrong // ok now also the 3rd turn is wrong
@@ -12,6 +12,8 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
#include <type_traits>
#include "test_relate.hpp" #include "test_relate.hpp"
#include "nan_cases.hpp" #include "nan_cases.hpp"
@@ -391,7 +393,7 @@ void test_multi_linestring_polygon()
"1F10F0212"); "1F10F0212");
if ( BOOST_GEOMETRY_CONDITION(( if ( BOOST_GEOMETRY_CONDITION((
boost::is_same<coord_t, double>::value )) ) std::is_same<coord_t, double>::value )) )
{ {
// assertion failure in 1.57 // assertion failure in 1.57
test_geometry<mls, poly>("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", test_geometry<mls, poly>("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))",
+1 -1
View File
@@ -205,7 +205,7 @@ void test_wrong_wkt_read_write(std::string const& wkt, std::string const& start)
// For ttmath we skip bad lexical casts // For ttmath we skip bad lexical casts
typedef typename bg::coordinate_type<G>::type ct; typedef typename bg::coordinate_type<G>::type ct;
if (boost::is_same<ct, ttmath_big>::type::value if (std::is_same<ct, ttmath_big>::type::value
&& boost::starts_with(start, "bad lexical cast")) && boost::starts_with(start, "bad lexical cast"))
{ {
check = false; check = false;
+4 -2
View File
@@ -17,6 +17,8 @@
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
#include <type_traits>
#include <geometry_test_common.hpp> #include <geometry_test_common.hpp>
#if defined(_MSC_VER) #if defined(_MSC_VER)
@@ -266,10 +268,10 @@ void test_integer(bool check_types)
if (check_types) if (check_types)
{ {
BOOST_CHECK((boost::is_same<distance_type, double>::type::value)); BOOST_CHECK((std::is_same<distance_type, double>::type::value));
// comparable_distance results in now double too, obviously because // comparable_distance results in now double too, obviously because
// comp.distance point-segment can be fraction, even for integer input // comp.distance point-segment can be fraction, even for integer input
BOOST_CHECK((boost::is_same<cdistance_type, double>::type::value)); BOOST_CHECK((std::is_same<cdistance_type, double>::type::value));
} }
} }
+3 -1
View File
@@ -14,6 +14,8 @@
#define BOOST_GEOMETRY_TEST_STRATEGIES_SEGMENT_INTERSECTION_SPH_HPP #define BOOST_GEOMETRY_TEST_STRATEGIES_SEGMENT_INTERSECTION_SPH_HPP
#include <type_traits>
#include <geometry_test_common.hpp> #include <geometry_test_common.hpp>
#include <boost/geometry/algorithms/equals.hpp> #include <boost/geometry/algorithms/equals.hpp>
@@ -97,7 +99,7 @@ void test_strategy_one(S1 const& s1, S2 const& s2,
// probably due to differences in FP trigonometric function implementations // probably due to differences in FP trigonometric function implementations
int eps_scale = 1; int eps_scale = 1;
bool is_geographic = boost::is_same<typename bg::cs_tag<S1>::type, bg::geographic_tag>::value; bool is_geographic = std::is_same<typename bg::cs_tag<S1>::type, bg::geographic_tag>::value;
if (is_geographic) if (is_geographic)
{ {
eps_scale = 100000; eps_scale = 100000;
+3 -2
View File
@@ -13,12 +13,13 @@
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
#include <type_traits>
#include <boost/test/included/test_exec_monitor.hpp> #include <boost/test/included/test_exec_monitor.hpp>
#include <boost/geometry/util/compress_variant.hpp> #include <boost/geometry/util/compress_variant.hpp>
#include <boost/mpl/assert.hpp> #include <boost/mpl/assert.hpp>
#include <boost/mpl/equal.hpp> #include <boost/mpl/equal.hpp>
#include <boost/mpl/vector.hpp> #include <boost/mpl/vector.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/variant/variant.hpp> #include <boost/variant/variant.hpp>
@@ -43,7 +44,7 @@ template <typename Variant, typename ExpectedType>
void test_single_type_result() void test_single_type_result()
{ {
BOOST_MPL_ASSERT(( BOOST_MPL_ASSERT((
boost::is_same< std::is_same<
typename boost::geometry::compress_variant<Variant>::type, typename boost::geometry::compress_variant<Variant>::type,
ExpectedType ExpectedType
> >
-1
View File
@@ -23,7 +23,6 @@
#include <boost/geometry/util/is_implemented.hpp> #include <boost/geometry/util/is_implemented.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/assert.hpp> #include <boost/mpl/assert.hpp>
#include <boost/mpl/bool.hpp> #include <boost/mpl/bool.hpp>
+5 -4
View File
@@ -13,13 +13,14 @@
// http://www.boost.org/LICENSE_1_0.txt) // http://www.boost.org/LICENSE_1_0.txt)
#include <type_traits>
#include <boost/test/included/test_exec_monitor.hpp> #include <boost/test/included/test_exec_monitor.hpp>
#include <boost/geometry/util/transform_variant.hpp> #include <boost/geometry/util/transform_variant.hpp>
#include <boost/mpl/assert.hpp> #include <boost/mpl/assert.hpp>
#include <boost/mpl/equal.hpp> #include <boost/mpl/equal.hpp>
#include <boost/mpl/placeholders.hpp> #include <boost/mpl/placeholders.hpp>
#include <boost/mpl/vector.hpp> #include <boost/mpl/vector.hpp>
#include <boost/type_traits.hpp>
#include <boost/variant/variant.hpp> #include <boost/variant/variant.hpp>
using boost::mpl::placeholders::_; using boost::mpl::placeholders::_;
@@ -42,7 +43,7 @@ int test_main(int, char* [])
// Transform Variant to Variant // Transform Variant to Variant
typedef boost::geometry::transform_variant< typedef boost::geometry::transform_variant<
boost::variant<int, float, long>, boost::variant<int, float, long>,
boost::add_pointer<_> std::add_pointer<_>
>::type transformed1; >::type transformed1;
check<boost::mpl::vector<int*, float*, long*> >(transformed1()); check<boost::mpl::vector<int*, float*, long*> >(transformed1());
@@ -50,7 +51,7 @@ int test_main(int, char* [])
// Transform Sequence to Variant (without inserter) // Transform Sequence to Variant (without inserter)
typedef boost::geometry::transform_variant< typedef boost::geometry::transform_variant<
boost::mpl::vector<int, float, long>, boost::mpl::vector<int, float, long>,
boost::add_pointer<_> std::add_pointer<_>
>::type transformed2; >::type transformed2;
check<boost::mpl::vector<int*, float*, long*> >(transformed2()); check<boost::mpl::vector<int*, float*, long*> >(transformed2());
@@ -58,7 +59,7 @@ int test_main(int, char* [])
// Transform Sequence to Variant (with inserter) // Transform Sequence to Variant (with inserter)
typedef boost::geometry::transform_variant< typedef boost::geometry::transform_variant<
boost::mpl::vector<int, float, long>, boost::mpl::vector<int, float, long>,
boost::add_pointer<_>, std::add_pointer<_>,
boost::mpl::back_inserter<boost::mpl::vector0<> > boost::mpl::back_inserter<boost::mpl::vector0<> >
>::type transformed3; >::type transformed3;