Skip to content

Commit

Permalink
Merge pull request #1268 from vissarion/fix/constexpr_index
Browse files Browse the repository at this point in the history
Fix BOOST_GEOMETRY_CONSTEXPR call in index (including support for c++17)
  • Loading branch information
vissarion committed Apr 1, 2024
2 parents f8e440d + bfa6d4a commit 38ba463
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/boost/geometry/index/detail/rtree/visitors/insert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,11 @@ class insert
// Enlarge it in case if it's not bounding geometry type.
// It's because Points and Segments are compared WRT machine epsilon
// This ensures that leafs bounds correspond to the stored elements
if (BOOST_GEOMETRY_CONSTEXPR ((std::is_same<Element, value_type>::value
if BOOST_GEOMETRY_CONSTEXPR ((std::is_same<Element, value_type>::value)
&& ! index::detail::is_bounding_geometry
<
typename indexable_type<translator_type>::type
>::value)))
>::value)
{
geometry::detail::expand_by_epsilon(m_element_bounds);
}
Expand Down Expand Up @@ -424,15 +424,16 @@ class insert
// Enlarge bounds of a leaf node.
// It's because Points and Segments are compared WRT machine epsilon
// This ensures that leafs' bounds correspond to the stored elements.
if (BOOST_GEOMETRY_CONSTEXPR ((std::is_same<Node, leaf>::value
if BOOST_GEOMETRY_CONSTEXPR ((std::is_same<Node, leaf>::value)
&& ! index::detail::is_bounding_geometry
<
typename indexable_type<translator_type>::type
>::value)))
>::value)
{
geometry::detail::expand_by_epsilon(n_box);
geometry::detail::expand_by_epsilon(additional_nodes[0].first);
}

#endif

// node is not the root - just add the new node
Expand Down

0 comments on commit 38ba463

Please sign in to comment.