Commit 9f487e46 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Enforce reverence/rvalue propagation in mk_range()

parent 293c8a36
...@@ -454,7 +454,8 @@ template <class Iter> ...@@ -454,7 +454,8 @@ template <class Iter>
class IterRange class IterRange
{ {
public: public:
IterRange(const std::pair<Iter, Iter>& range): _range(range) {} explicit IterRange(std::pair<Iter, Iter>&& range)
: _range(std::forward<std::pair<Iter, Iter>>(range)) {}
const Iter& begin() { return _range.first; } const Iter& begin() { return _range.first; }
const Iter& end() { return _range.second; } const Iter& end() { return _range.second; }
private: private:
...@@ -463,9 +464,9 @@ private: ...@@ -463,9 +464,9 @@ private:
template <class Iter> template <class Iter>
inline inline
IterRange<Iter> mk_range(const std::pair<Iter, Iter>& range) IterRange<Iter> mk_range(std::pair<Iter, Iter>&& range)
{ {
return IterRange<Iter>(range); return IterRange<Iter>(std::forward<std::pair<Iter, Iter>>(range));
} }
template <class Graph> template <class Graph>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment