diff --git a/include/interval-tree/interval_tree.hpp b/include/interval-tree/interval_tree.hpp index 61543df..a9c9b97 100644 --- a/include/interval-tree/interval_tree.hpp +++ b/include/interval-tree/interval_tree.hpp @@ -205,6 +205,11 @@ namespace lib_interval_tree friend lib_interval_tree::interval_tree_iterator , true>; friend lib_interval_tree::interval_tree_iterator , false>; + template + friend void increment(T& iter); + template + friend void increment_reverse(T& iter); + public: node(node* parent, interval_type interval) : interval_{std::move(interval)} @@ -432,8 +437,10 @@ namespace lib_interval_tree const_interval_tree_iterator& operator=(const_interval_tree_iterator const&) = default; const_interval_tree_iterator& operator=(const_interval_tree_iterator&&) noexcept = default; - friend void increment>(const_interval_tree_iterator& iter); - friend void increment_reverse>(const_interval_tree_iterator& iter); + template + friend void increment(T& iter); + template + friend void increment_reverse(T& iter); const_interval_tree_iterator& operator++() { @@ -535,8 +542,10 @@ namespace lib_interval_tree interval_tree_iterator& operator=(interval_tree_iterator const&) = default; interval_tree_iterator& operator=(interval_tree_iterator&&) noexcept = default; - friend void increment>(interval_tree_iterator& iter); - friend void increment_reverse>(interval_tree_iterator& iter); + template + friend void increment(T& iter); + template + friend void increment_reverse(T& iter); interval_tree_iterator& operator++() { @@ -702,6 +711,11 @@ namespace lib_interval_tree friend interval_tree_iterator ; friend interval_tree_iterator ; + template + friend void increment(T& iter); + template + friend void increment_reverse(T& iter); + public: interval_tree() : root_{nullptr}