mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 05:24:02 +00:00
[example][index] Fix serialization example.
This commit is contained in:
parent
b786bd9dd9
commit
3802d235d1
@ -1,7 +1,7 @@
|
|||||||
// Boost.Geometry Index
|
// Boost.Geometry Index
|
||||||
// Additional tests
|
// Additional tests
|
||||||
|
|
||||||
// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
|
// Copyright (c) 2011-2021 Adam Wulkiewicz, Lodz, Poland.
|
||||||
|
|
||||||
// Use, modification and distribution is subject to the Boost Software License,
|
// Use, modification and distribution is subject to the Boost Software License,
|
||||||
// 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
|
||||||
@ -25,13 +25,13 @@
|
|||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/timer.hpp>
|
#include <boost/timer.hpp>
|
||||||
|
|
||||||
template <typename T, size_t I = 0, size_t S = boost::tuples::length<T>::value>
|
template <typename T, size_t I = 0, size_t S = std::tuple_size<T>::value>
|
||||||
struct print_tuple
|
struct print_tuple
|
||||||
{
|
{
|
||||||
template <typename Os>
|
template <typename Os>
|
||||||
static inline Os & apply(Os & os, T const& t)
|
static inline Os & apply(Os & os, T const& t)
|
||||||
{
|
{
|
||||||
os << boost::get<I>(t) << ", ";
|
os << std::get<I>(t) << ", ";
|
||||||
return print_tuple<T, I+1>::apply(os, t);
|
return print_tuple<T, I+1>::apply(os, t);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -51,7 +51,7 @@ int main()
|
|||||||
namespace bg = boost::geometry;
|
namespace bg = boost::geometry;
|
||||||
namespace bgi = bg::index;
|
namespace bgi = bg::index;
|
||||||
|
|
||||||
typedef boost::tuple<std::size_t, std::size_t, std::size_t, std::size_t, std::size_t, std::size_t> S;
|
typedef std::tuple<std::size_t, std::size_t, std::size_t, std::size_t, std::size_t, std::size_t> S;
|
||||||
|
|
||||||
typedef bg::model::point<double, 2, bg::cs::cartesian> P;
|
typedef bg::model::point<double, 2, bg::cs::cartesian> P;
|
||||||
typedef bg::model::box<P> B;
|
typedef bg::model::box<P> B;
|
||||||
@ -81,7 +81,7 @@ int main()
|
|||||||
std::cout << "vector and tree created in: " << t.elapsed() << std::endl;
|
std::cout << "vector and tree created in: " << t.elapsed() << std::endl;
|
||||||
|
|
||||||
print_tuple<S>::apply(std::cout, bgi::detail::rtree::utilities::statistics(tree)) << std::endl;
|
print_tuple<S>::apply(std::cout, bgi::detail::rtree::utilities::statistics(tree)) << std::endl;
|
||||||
std::cout << boost::get<0>(s) << std::endl;
|
std::cout << std::get<0>(s) << std::endl;
|
||||||
BOOST_FOREACH(V const& v, tree | bgi::adaptors::queried(bgi::intersects(q)))
|
BOOST_FOREACH(V const& v, tree | bgi::adaptors::queried(bgi::intersects(q)))
|
||||||
std::cout << bg::wkt<V>(v) << std::endl;
|
std::cout << bg::wkt<V>(v) << std::endl;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user