File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ namespace lib_interval_tree
16
16
{
17
17
namespace
18
18
{
19
- using int_tree_for_draw = interval_tree <int , closed>;
19
+ using int_tree_for_draw = interval_tree <interval< int , closed> >;
20
20
using int_tree_iterator = int_tree_for_draw::iterator;
21
21
using const_int_tree_iterator = int_tree_for_draw::const_iterator;
22
22
Original file line number Diff line number Diff line change @@ -673,9 +673,10 @@ namespace lib_interval_tree
673
673
/* *
674
674
* Inserts an interval into the tree.
675
675
*/
676
- iterator insert (interval_type const & ival)
676
+ template <typename IntervalType = interval_type>
677
+ iterator insert (IntervalType&& ival)
677
678
{
678
- node_type* z = new node_type (nullptr , ival);
679
+ node_type* z = new node_type (nullptr , std::forward <IntervalType&&> ( ival) );
679
680
node_type* y = nullptr ;
680
681
node_type* x = root_;
681
682
while (x)
@@ -708,9 +709,10 @@ namespace lib_interval_tree
708
709
* @param ival The interval
709
710
* @param exclusive Exclude borders.
710
711
*/
711
- iterator insert_overlap (interval_type const & ival, bool exclusive = false )
712
+ template <typename IntervalType = interval_type>
713
+ iterator insert_overlap (IntervalType&& ival, bool exclusive = false )
712
714
{
713
- auto iter = overlap_find (ival, exclusive);
715
+ auto iter = overlap_find (std::forward <IntervalType&&> ( ival) , exclusive);
714
716
if (iter == end ())
715
717
return insert (ival);
716
718
else
You can’t perform that action at this time.
0 commit comments