From dd6430083d9be691bd3dcacf263aa60a6431b621 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sat, 8 Dec 2012 23:47:52 +0000 Subject: [PATCH] Coding style improved (issues detected by Boost Inspect tool). [SVN r81802] --- .../rtree/linear/redistribute_elements.hpp | 26 ++-- .../index/rtree/node/dynamic_visitor.hpp | 8 +- .../index/rtree/node/node_d_mem_dynamic.hpp | 8 +- .../index/rtree/node/node_d_mem_static.hpp | 6 +- .../index/rtree/node/node_s_mem_dynamic.hpp | 22 +-- .../index/rtree/node/node_s_mem_static.hpp | 8 +- .../index/rtree/node/static_visitor.hpp | 18 +-- .../rtree/quadratic/redistribute_elements.hpp | 10 +- .../index/rtree/rstar/choose_next_node.hpp | 138 +++++++++--------- .../extensions/index/rtree/rstar/insert.hpp | 2 +- .../index/rtree/visitors/insert.hpp | 2 +- test/rtree/test_rtree.hpp | 4 +- test/rtree/test_rtree_exceptions.hpp | 6 +- tests/additional_glut_vis.cpp | 10 +- tests/additional_sizes_and_times.cpp | 10 +- tests/additional_speed.cpp | 9 ++ tests/main.cpp | 10 +- tests/rtree_filters.hpp | 11 +- tests/rtree_function.hpp | 9 ++ tests/t1.cpp | 9 ++ tests/t2.cpp | 10 +- tests/translators.hpp | 33 +++-- 22 files changed, 211 insertions(+), 158 deletions(-) diff --git a/include/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp b/include/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp index 910b77a39..fb52e3b5e 100644 --- a/include/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp +++ b/include/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp @@ -54,9 +54,9 @@ struct find_greatest_normalized_separation size_t & seed1, size_t & seed2) { - const size_t elements_count = parameters.get_max_elements() + 1; - BOOST_GEOMETRY_INDEX_ASSERT(elements.size() == elements_count, "unexpected number of elements"); - BOOST_GEOMETRY_INDEX_ASSERT(2 <= elements_count, "unexpected number of elements"); + const size_t elements_count = parameters.get_max_elements() + 1; + BOOST_GEOMETRY_INDEX_ASSERT(elements.size() == elements_count, "unexpected number of elements"); + BOOST_GEOMETRY_INDEX_ASSERT(2 <= elements_count, "unexpected number of elements"); // find the lowest low, highest high coordinate_type lowest_low = index::get(rtree::element_indexable(elements[0], translator)); @@ -180,9 +180,9 @@ struct pick_seeds static inline void apply(Elements const& elements, Parameters const& parameters, - Translator const& tr, - size_t & seed1, - size_t & seed2) + Translator const& tr, + size_t & seed1, + size_t & seed2) { coordinate_type separation = 0; pick_seeds_impl::apply(elements, parameters, tr, separation, seed1, seed2); @@ -217,14 +217,14 @@ struct redistribute_elements::type coordinate_type; typedef typename index::default_content_result::type content_type; - elements_type & elements1 = rtree::elements(n); - elements_type & elements2 = rtree::elements(second_node); - const size_t elements1_count = parameters.get_max_elements() + 1; + elements_type & elements1 = rtree::elements(n); + elements_type & elements2 = rtree::elements(second_node); + const size_t elements1_count = parameters.get_max_elements() + 1; - BOOST_GEOMETRY_INDEX_ASSERT(elements1.size() == elements1_count, "unexpected number of elements"); + BOOST_GEOMETRY_INDEX_ASSERT(elements1.size() == elements1_count, "unexpected number of elements"); - // copy original elements - elements_type elements_copy(elements1); // MAY THROW, STRONG (alloc, copy) + // copy original elements + elements_type elements_copy(elements1); // MAY THROW, STRONG (alloc, copy) // calculate initial seeds size_t seed1 = 0; @@ -309,7 +309,7 @@ struct redistribute_elements template inline Derived & get(dynamic_node & n) { - assert(dynamic_cast(&n)); + BOOST_GEOMETRY_INDEX_ASSERT(dynamic_cast(&n), "can't cast to a Derived type"); return static_cast(n); } template inline Derived * get(dynamic_node * n) { - assert(dynamic_cast(n)); + BOOST_GEOMETRY_INDEX_ASSERT(dynamic_cast(n), "can't cast to a Derived type"); return static_cast(n); } // apply visitor template -inline void apply_visitor(Visitor &v, Visitable & n) +inline void apply_visitor(Visitor & v, Visitable & n) { - assert(&n); + BOOST_GEOMETRY_INDEX_ASSERT(&n, "null ptr"); n.apply_visitor(v); } diff --git a/include/boost/geometry/extensions/index/rtree/node/node_d_mem_dynamic.hpp b/include/boost/geometry/extensions/index/rtree/node/node_d_mem_dynamic.hpp index e66cef8c7..66aa289f1 100644 --- a/include/boost/geometry/extensions/index/rtree/node/node_d_mem_dynamic.hpp +++ b/include/boost/geometry/extensions/index/rtree/node/node_d_mem_dynamic.hpp @@ -108,7 +108,7 @@ template inline typename Translator::result_type element_indexable(Value const& el, Translator const& tr) { - return tr(el); + return tr(el); } template @@ -125,21 +125,21 @@ element_indexable( template struct elements_type { - typedef typename Node::elements_type type; + typedef typename Node::elements_type type; }; template inline typename elements_type::type & elements(Node & n) { - return n.elements; + return n.elements; } template inline typename elements_type::type const& elements(Node const& n) { - return n.elements; + return n.elements; } // elements derived type diff --git a/include/boost/geometry/extensions/index/rtree/node/node_d_mem_static.hpp b/include/boost/geometry/extensions/index/rtree/node/node_d_mem_static.hpp index 35d087a15..ff70774c3 100644 --- a/include/boost/geometry/extensions/index/rtree/node/node_d_mem_static.hpp +++ b/include/boost/geometry/extensions/index/rtree/node/node_d_mem_static.hpp @@ -20,14 +20,14 @@ namespace detail { namespace rtree { template struct dynamic_internal_node - : public dynamic_node + : public dynamic_node { typedef index::pushable_array< std::pair< Box, dynamic_node * >, - Parameters::max_elements + 1 + Parameters::max_elements + 1 > elements_type; template @@ -41,7 +41,7 @@ struct dynamic_internal_node struct dynamic_leaf - : public dynamic_node + : public dynamic_node { typedef index::pushable_array elements_type; diff --git a/include/boost/geometry/extensions/index/rtree/node/node_s_mem_dynamic.hpp b/include/boost/geometry/extensions/index/rtree/node/node_s_mem_dynamic.hpp index 6f14beb80..237141e74 100644 --- a/include/boost/geometry/extensions/index/rtree/node/node_s_mem_dynamic.hpp +++ b/include/boost/geometry/extensions/index/rtree/node/node_s_mem_dynamic.hpp @@ -59,10 +59,10 @@ struct static_leaf template struct node { - typedef boost::variant< - static_leaf, - static_internal_node - > type; + typedef boost::variant< + static_leaf, + static_internal_node + > type; }; template @@ -107,13 +107,13 @@ struct element_indexable_type< template inline Box const& element_indexable(std::pair< - Box, - boost::variant< - static_leaf, - static_internal_node - > * - > const& el, - Translator const&) + Box, + boost::variant< + static_leaf, + static_internal_node + > * + > const& el, + Translator const&) { return el.first; } diff --git a/include/boost/geometry/extensions/index/rtree/node/node_s_mem_static.hpp b/include/boost/geometry/extensions/index/rtree/node/node_s_mem_static.hpp index 67e9b9ea9..8220b3de4 100644 --- a/include/boost/geometry/extensions/index/rtree/node/node_s_mem_static.hpp +++ b/include/boost/geometry/extensions/index/rtree/node/node_s_mem_static.hpp @@ -54,10 +54,10 @@ struct static_leaf template struct node { - typedef boost::variant< - static_leaf, - static_internal_node - > type; + typedef boost::variant< + static_leaf, + static_internal_node + > type; }; template diff --git a/include/boost/geometry/extensions/index/rtree/node/static_visitor.hpp b/include/boost/geometry/extensions/index/rtree/node/static_visitor.hpp index 70524f036..cf089b3d2 100644 --- a/include/boost/geometry/extensions/index/rtree/node/static_visitor.hpp +++ b/include/boost/geometry/extensions/index/rtree/node/static_visitor.hpp @@ -51,22 +51,22 @@ inline V * get( template inline void apply_visitor(Visitor & v, - boost::variant< - static_leaf, - static_internal_node - > & n) + boost::variant< + static_leaf, + static_internal_node + > & n) { boost::apply_visitor(v, n); } template inline void apply_visitor(Visitor & v, - boost::variant< - static_leaf, - static_internal_node - > const& n) + boost::variant< + static_leaf, + static_internal_node + > const& n) { - boost::apply_visitor(v, n); + boost::apply_visitor(v, n); } }} // namespace detail::rtree diff --git a/include/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp b/include/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp index d651777eb..e4bf7d42b 100644 --- a/include/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp +++ b/include/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp @@ -44,8 +44,8 @@ struct pick_seeds size_t & seed2) { const size_t elements_count = parameters.get_max_elements() + 1; - BOOST_GEOMETRY_INDEX_ASSERT(elements.size() == elements_count, "wrong number of elements"); - BOOST_GEOMETRY_INDEX_ASSERT(2 <= elements_count, "unexpected number of elements"); + BOOST_GEOMETRY_INDEX_ASSERT(elements.size() == elements_count, "wrong number of elements"); + BOOST_GEOMETRY_INDEX_ASSERT(2 <= elements_count, "unexpected number of elements"); content_type greatest_free_content = 0; seed1 = 0; @@ -80,7 +80,7 @@ struct pick_seeds template struct redistribute_elements { - typedef typename Options::parameters_type parameters_type; + typedef typename Options::parameters_type parameters_type; typedef typename rtree::node::type node; typedef typename rtree::internal_node::type internal_node; @@ -216,12 +216,12 @@ struct redistribute_elements::type leaf; typedef typename rtree::elements_type::type children_type; - typedef typename children_type::value_type child_type; + typedef typename children_type::value_type child_type; - typedef typename Options::parameters_type parameters_type; + typedef typename Options::parameters_type parameters_type; typedef typename index::default_content_result::type content_type; @@ -53,13 +53,13 @@ public: // children are leafs if ( node_relative_level <= 1 ) - { - if ( 0 < parameters.get_overlap_cost_threshold() && - parameters.get_overlap_cost_threshold() < children.size() ) - return choose_by_nearly_minimum_overlap_cost(children, indexable, parameters.get_overlap_cost_threshold()); - else - return choose_by_minimum_overlap_cost(children, indexable); - } + { + if ( 0 < parameters.get_overlap_cost_threshold() && + parameters.get_overlap_cost_threshold() < children.size() ) + return choose_by_nearly_minimum_overlap_cost(children, indexable, parameters.get_overlap_cost_threshold()); + else + return choose_by_minimum_overlap_cost(children, indexable); + } // children are internal nodes else return choose_by_minimum_content_cost(children, indexable); @@ -123,86 +123,86 @@ private: return choosen_index; } - template - static inline size_t choose_by_nearly_minimum_overlap_cost(children_type const& children, + template + static inline size_t choose_by_nearly_minimum_overlap_cost(children_type const& children, Indexable const& indexable, size_t overlap_cost_threshold) - { - const size_t children_count = children.size(); + { + const size_t children_count = children.size(); - // create container of children sorted by content enlargement needed to include the new value - std::vector< boost::tuple > sorted_children(children_count); - for ( size_t i = 0 ; i < children_count ; ++i ) - { - child_type const& ch_i = children[i]; + // create container of children sorted by content enlargement needed to include the new value + std::vector< boost::tuple > sorted_children(children_count); + for ( size_t i = 0 ; i < children_count ; ++i ) + { + child_type const& ch_i = children[i]; - // expanded child node's box - Box box_exp(ch_i.first); - geometry::expand(box_exp, indexable); + // expanded child node's box + Box box_exp(ch_i.first); + geometry::expand(box_exp, indexable); - // areas difference - content_type content = index::content(box_exp); - content_type content_diff = content - index::content(ch_i.first); + // areas difference + content_type content = index::content(box_exp); + content_type content_diff = content - index::content(ch_i.first); - sorted_children[i] = boost::make_tuple(i, content_diff, content); - } + sorted_children[i] = boost::make_tuple(i, content_diff, content); + } - // sort by content_diff - std::sort(sorted_children.begin(), sorted_children.end(), content_diff_less); + // sort by content_diff + std::sort(sorted_children.begin(), sorted_children.end(), content_diff_less); - BOOST_GEOMETRY_INDEX_ASSERT(overlap_cost_threshold <= children_count, "there are not enough children"); + BOOST_GEOMETRY_INDEX_ASSERT(overlap_cost_threshold <= children_count, "there are not enough children"); - // for overlap_cost_threshold child nodes find the one with smallest overlap value - size_t choosen_index = 0; - content_type smallest_overlap_diff = (std::numeric_limits::max)(); + // for overlap_cost_threshold child nodes find the one with smallest overlap value + size_t choosen_index = 0; + content_type smallest_overlap_diff = (std::numeric_limits::max)(); - // for each node - for (size_t i = 0 ; i < overlap_cost_threshold ; ++i ) - { - size_t child_index = boost::get<0>(sorted_children[i]); + // for each node + for (size_t i = 0 ; i < overlap_cost_threshold ; ++i ) + { + size_t child_index = boost::get<0>(sorted_children[i]); - typedef typename children_type::value_type child_type; - child_type const& ch_i = children[child_index]; + typedef typename children_type::value_type child_type; + child_type const& ch_i = children[child_index]; - Box box_exp(ch_i.first); - // calculate expanded box of child node ch_i - geometry::expand(box_exp, indexable); + Box box_exp(ch_i.first); + // calculate expanded box of child node ch_i + geometry::expand(box_exp, indexable); - content_type overlap = 0; - content_type overlap_exp = 0; + content_type overlap = 0; + content_type overlap_exp = 0; - // calculate overlap - for ( size_t j = 0 ; j < children_count ; ++j ) - { - if ( child_index != j ) - { - child_type const& ch_j = children[j]; + // calculate overlap + for ( size_t j = 0 ; j < children_count ; ++j ) + { + if ( child_index != j ) + { + child_type const& ch_j = children[j]; - overlap += index::intersection_content(ch_i.first, ch_j.first); - overlap_exp += index::intersection_content(box_exp, ch_j.first); - } - } + overlap += index::intersection_content(ch_i.first, ch_j.first); + overlap_exp += index::intersection_content(box_exp, ch_j.first); + } + } - content_type overlap_diff = overlap_exp - overlap; + content_type overlap_diff = overlap_exp - overlap; - // update result - if ( overlap_diff < smallest_overlap_diff ) - { - smallest_overlap_diff = overlap_diff; - choosen_index = child_index; - } - } + // update result + if ( overlap_diff < smallest_overlap_diff ) + { + smallest_overlap_diff = overlap_diff; + choosen_index = child_index; + } + } - return choosen_index; - } + return choosen_index; + } - static inline bool content_diff_less(boost::tuple const& p1, boost::tuple const& p2) - { - return boost::get<1>(p1) < boost::get<1>(p2) || - (boost::get<1>(p1) == boost::get<1>(p2) && boost::get<2>(p1) < boost::get<2>(p2)); - } + static inline bool content_diff_less(boost::tuple const& p1, boost::tuple const& p2) + { + return boost::get<1>(p1) < boost::get<1>(p2) || + (boost::get<1>(p1) == boost::get<1>(p2) && boost::get<2>(p1) < boost::get<2>(p2)); + } - template + template static inline size_t choose_by_minimum_content_cost(children_type const& children, Indexable const& indexable) { size_t children_count = children.size(); diff --git a/include/boost/geometry/extensions/index/rtree/rstar/insert.hpp b/include/boost/geometry/extensions/index/rtree/rstar/insert.hpp index 3f34914ee..e7e7567c2 100644 --- a/include/boost/geometry/extensions/index/rtree/rstar/insert.hpp +++ b/include/boost/geometry/extensions/index/rtree/rstar/insert.hpp @@ -295,7 +295,7 @@ struct level_insert inline void operator()(leaf &) { - assert(false); + BOOST_GEOMETRY_INDEX_ASSERT(false, "this visitor can't be used for a leaf"); } }; diff --git a/include/boost/geometry/extensions/index/rtree/visitors/insert.hpp b/include/boost/geometry/extensions/index/rtree/visitors/insert.hpp index 660d9da09..d7e88dbe4 100644 --- a/include/boost/geometry/extensions/index/rtree/visitors/insert.hpp +++ b/include/boost/geometry/extensions/index/rtree/visitors/insert.hpp @@ -449,7 +449,7 @@ public: inline void operator()(leaf &) { - assert(false); + BOOST_GEOMETRY_INDEX_ASSERT(false, "this visitor can't be used for a leaf"); } }; diff --git a/test/rtree/test_rtree.hpp b/test/rtree/test_rtree.hpp index 90ee4acaf..9ec8e7dcc 100644 --- a/test/rtree/test_rtree.hpp +++ b/test/rtree/test_rtree.hpp @@ -253,7 +253,7 @@ struct generate_input<2> template static void apply(std::vector & input, Box & qbox, int size = 1) { - assert(0 < size); + BOOST_GEOMETRY_INDEX_ASSERT(0 < size, "the value must be greather than 0"); for ( int i = 0 ; i < 12 * size ; i += 3 ) { @@ -275,7 +275,7 @@ struct generate_input<3> template static void apply(std::vector & input, Box & qbox, int size = 1) { - assert(0 < size); + BOOST_GEOMETRY_INDEX_ASSERT(0 < size, "the value must be greather than 0"); for ( int i = 0 ; i < 12 * size ; i += 3 ) { diff --git a/test/rtree/test_rtree_exceptions.hpp b/test/rtree/test_rtree_exceptions.hpp index 8b6d68402..9c6fc62f3 100644 --- a/test/rtree/test_rtree_exceptions.hpp +++ b/test/rtree/test_rtree_exceptions.hpp @@ -73,14 +73,14 @@ namespace detail { namespace rtree { template struct dynamic_internal_node - : public dynamic_node + : public dynamic_node { typedef throwing_pushable_array< std::pair< Box, dynamic_node * >, - Parameters::max_elements + 1 + Parameters::max_elements + 1 > elements_type; template @@ -94,7 +94,7 @@ struct dynamic_internal_node struct dynamic_leaf - : public dynamic_node + : public dynamic_node { typedef throwing_pushable_array elements_type; diff --git a/tests/additional_glut_vis.cpp b/tests/additional_glut_vis.cpp index 647b72b6b..4dab18cff 100644 --- a/tests/additional_glut_vis.cpp +++ b/tests/additional_glut_vis.cpp @@ -1,8 +1,8 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) -// -// Boost.Index - example -// -// Copyright 2011 Adam Wulkiewicz. +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. + // 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) diff --git a/tests/additional_sizes_and_times.cpp b/tests/additional_sizes_and_times.cpp index 6749725b8..05d24995f 100644 --- a/tests/additional_sizes_and_times.cpp +++ b/tests/additional_sizes_and_times.cpp @@ -1,8 +1,8 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) -// -// Boost.Index - example -// -// Copyright 2011 Adam Wulkiewicz. +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. + // 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) diff --git a/tests/additional_speed.cpp b/tests/additional_speed.cpp index 71d669b90..d56c4f613 100644 --- a/tests/additional_speed.cpp +++ b/tests/additional_speed.cpp @@ -1,3 +1,12 @@ +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. + +// 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 diff --git a/tests/main.cpp b/tests/main.cpp index 50a1d4632..0fc440ff3 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -1,8 +1,8 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) -// -// Boost.Index - unit tests -// -// Copyright 2011 Adam Wulkiewicz. +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. + // 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) diff --git a/tests/rtree_filters.hpp b/tests/rtree_filters.hpp index 86a9454af..6dd0c82a8 100644 --- a/tests/rtree_filters.hpp +++ b/tests/rtree_filters.hpp @@ -1,3 +1,12 @@ +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. + +// 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) + #ifndef TESTS_RTREE_FILTERS_HPP #define TESTS_RTREE_FILTERS_HPP @@ -32,7 +41,7 @@ BOOST_AUTO_TEST_CASE(tests_rtree_query_filter) { #ifdef TEST_PRINT_INFO - std::cout << "tests/rtree_filters.hpp\n"; + std::cout << "tests/rtree_filters.hpp\n"; #endif typedef boost::geometry::model::point P; diff --git a/tests/rtree_function.hpp b/tests/rtree_function.hpp index a9e442aab..bae08189b 100644 --- a/tests/rtree_function.hpp +++ b/tests/rtree_function.hpp @@ -1,3 +1,12 @@ +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. + +// 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) + #ifndef TESTS_RTREE_FUNCTION_HPP #define TESTS_RTREE_FUNCTION_HPP diff --git a/tests/t1.cpp b/tests/t1.cpp index 4ad96e2e6..2bb455e62 100644 --- a/tests/t1.cpp +++ b/tests/t1.cpp @@ -1,3 +1,12 @@ +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. + +// 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 diff --git a/tests/t2.cpp b/tests/t2.cpp index e0eab887c..ab888fbca 100644 --- a/tests/t2.cpp +++ b/tests/t2.cpp @@ -1,3 +1,11 @@ +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. + +// 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 @@ -63,4 +71,4 @@ int main() std::cout << "Total objects: " << rTree.size(); std::cin.get(); return 0; -} \ No newline at end of file +} diff --git a/tests/translators.hpp b/tests/translators.hpp index 133da68ec..dda074baf 100644 --- a/tests/translators.hpp +++ b/tests/translators.hpp @@ -1,3 +1,12 @@ +// Boost.Geometry Index +// Additional tests + +// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland. + +// 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) + #ifndef TESTS_TRANSLATORS_HPP #define TESTS_TRANSLATORS_HPP @@ -19,17 +28,17 @@ struct tests_translators_val : i(ii) {} - Indexable const& get_box() const - { - return i; - } + Indexable const& get_box() const + { + return i; + } - bool operator==(tests_translators_val const& v2) - { - return boost::geometry::equals(i, v2.i); - } + bool operator==(tests_translators_val const& v2) + { + return boost::geometry::equals(i, v2.i); + } - Indexable i; + Indexable i; }; BOOST_AUTO_TEST_CASE(tests_translators) @@ -43,7 +52,7 @@ BOOST_AUTO_TEST_CASE(tests_translators) namespace bgi = bg::index; namespace bgit = bgi::translator; - typedef bgm::point P; + typedef bgm::point P; typedef bgm::box

B; bgit::def< P > p; @@ -81,8 +90,8 @@ BOOST_AUTO_TEST_CASE(tests_translators) BOOST_CHECK( bg::equals(tmp_p, scpip(tmp_scpip)) ); BOOST_CHECK( bg::equals(tmp_p, scppi(tmp_scppi)) ); - //bgit::def d; // error - //bgit::def< bgm::segment

> d; // error + //bgit::def d; // error + //bgit::def< bgm::segment

> d; // error B tmp_b(P(2, 3), P(4, 5)); std::pair, B> tmp_ppb =