// Boost.Geometry // Unit Test // Copyright (c) 2019 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include namespace bgd = boost::geometry::detail; namespace bgt = boost::geometry::tuples; namespace bgr = boost::geometry::range; template void add_points(MultiPoint & mp) { typedef typename bg::point_type::type point_type; bg::range::push_back(mp, point_type(1, 2)); bg::range::push_back(mp, point_type(2, 3)); bg::range::push_back(mp, point_type(3, 4)); } template void test_range_values() { typedef typename bgd::tupled_range_values::type tuple_s; BOOST_CHECK_EQUAL((boost::is_same::value), true); } template void test_back_inserters() { typedef typename bgd::tupled_back_inserters::type tuple_bi; BOOST_CHECK_EQUAL((boost::is_same::value), true); TupleM tup; bgd::tupled_back_inserters::apply(tup); } template void test_all() { BOOST_CHECK_EQUAL((bgd::is_tupled_output::value), false); BOOST_CHECK_EQUAL((bgd::is_tupled_output::value), true); BOOST_CHECK_EQUAL((bgd::tupled_output_has::value), false); BOOST_CHECK_EQUAL((bgd::tupled_output_has::value), true); BOOST_CHECK_EQUAL((bgd::tupled_output_has::value), false); BOOST_CHECK_EQUAL((bgd::tupled_output_has::value), false); TupleLsMPt tup; add_points(bgd::tupled_output_get(tup)); BOOST_CHECK_EQUAL((boost::size(bgt::get<1>(tup))), 3u); } int test_main(int, char* []) { typedef bg::model::point point; typedef bg::model::linestring linestring; typedef bg::model::polygon polygon; typedef bg::model::multi_point multi_point; typedef bg::model::multi_linestring multi_linestring; //typedef bg::model::multi_polygon multi_polygon; BOOST_CHECK_EQUAL((bg::range::detail::is_range::value), false); BOOST_CHECK_EQUAL((bg::range::detail::is_range::value), true); BOOST_CHECK_EQUAL((bg::range::detail::is_range::value), true); BOOST_CHECK_EQUAL((bgd::is_tupled_output_element::value), false); BOOST_CHECK_EQUAL((bgd::is_tupled_output_element::value), false); BOOST_CHECK_EQUAL((bgd::is_tupled_output_element::value), true); test_all, boost::tuple >(); test_all, std::pair >(); test_range_values, boost::tuples::cons > >(); test_range_values, std::pair >(); test_back_inserters, boost::tuples::cons, boost::tuples::cons, boost::tuples::null_type> > >(); test_back_inserters, std::pair, bgr::back_insert_iterator > >(); #if !defined(BOOST_NO_CXX11_HDR_TUPLE) && !defined(BOOST_NO_VARIADIC_TEMPLATES) test_all, std::tuple >(); test_range_values, std::tuple >(); test_back_inserters, std::tuple, bgr::back_insert_iterator > >(); #endif return 0; }