Summary
overlap_find_next_in_subtree fails to compile because it passes exclusive as a third function argument:
overlap_find_i_ex(from.node_, ival, exclusive)
However, overlap_find_i_ex accepts only two arguments and represents exclusivity as a template parameter:
template <bool Exclusive>
node_type* overlap_find_i_ex(
node_type* ptr,
interval_type const& ival
) const;
The caller must invoke either overlap_find_i_ex<true> or overlap_find_i_ex<false>. Both the iterator and const_iterator overloads are affected.
Steps to reproduce
#include<interval-tree/interval_tree.hpp>usingnamespacelib_interval_tree;intmain()
{
using Interval = interval<int, closed>;
interval_tree<Interval> tree;
tree.insert(Interval{1, 5});
auto it = tree.overlap_find_next_in_subtree(
tree.begin(),
Interval{2, 3}
);
(void)it;
}Compile with:
g++ -std=c++17 -Iinclude repro.cpp
Expected: the call compiles and returns an iterator to an overlapping interval.
Actual: compilation fails because overlap_find_i_ex is called with three arguments instead of two.
Suggested fix
Dispatch to the appropriate template specialization:
auto* result = exclusive
? overlap_find_i_ex<true>(from.node_, ival)
: overlap_find_i_ex<false>(from.node_, ival);
return iterator{result, this};Apply the same change to the const_iterator overload and add tests for both values of exclusive.
Summary
overlap_find_next_in_subtreefails to compile because it passesexclusiveas a third function argument:overlap_find_i_ex(from.node_, ival, exclusive)However,
overlap_find_i_exaccepts only two arguments and represents exclusivity as a template parameter:The caller must invoke either
overlap_find_i_ex<true>oroverlap_find_i_ex<false>. Both theiteratorandconst_iteratoroverloads are affected.Steps to reproduce
Compile with:
Expected: the call compiles and returns an iterator to an overlapping interval.
Actual: compilation fails because
overlap_find_i_exis called with three arguments instead of two.Suggested fix
Dispatch to the appropriate template specialization:
Apply the same change to the
const_iteratoroverload and add tests for both values ofexclusive.