Changeset 4024


Ignore:
Timestamp:
Jan 4, 2021, 11:53:27 AM (9 months ago)
Author:
Peter
Message:

refs #968; SegmentTree::insert taking rvalue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/SegmentTree.h

    r3114 r4024  
    55
    66/*
    7   Copyright (C) 2010, 2011, 2012, 2013 Peter Johansson
     7  Copyright (C) 2010, 2011, 2012, 2013, 2021 Peter Johansson
    88
    99  This file is part of the yat library, http://dev.thep.lu.se/yat
     
    2929#include <algorithm>
    3030#include <functional>
     31#include <utility>
    3132
    3233namespace theplu {
     
    180181
    181182    /**
     183       Same as insert(const&) but move \a value rather than copy.
     184
     185       \since New in yat 0.19
     186     */
     187    std::pair<iterator, bool> insert(value_type&& value);
     188
     189    /**
    182190       \return Comparison functor to compare two keys (Segment)
    183191     */
     
    301309
    302310  template<typename T, class Compare, class Value2Key>
     311  std::pair<typename SegmentTree<T, Compare, Value2Key>::iterator, bool>
     312  SegmentTree<T, Compare,Value2Key>::insert(value_type&& segment)
     313  {
     314    return container_.insert(std::move(segment));
     315  }
     316
     317
     318  template<typename T, class Compare, class Value2Key>
    303319  typename SegmentTree<T, Compare, Value2Key>::iterator
    304320  SegmentTree<T, Compare,Value2Key>::lower_bound(const element_type& element)
Note: See TracChangeset for help on using the changeset viewer.