Simplify make_range by using move semantics

Move the iterators into the range the same way the range's ctor moves
them into the members.

Also remove some redundant top level parens in the return statement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205993 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2014-04-10 22:03:48 +00:00
parent eb690d8491
commit 83ee956104

View File

@ -45,8 +45,8 @@ public:
///
/// This provides a bit of syntactic sugar to make using sub-ranges
/// in for loops a bit easier. Analogous to std::make_pair().
template<class T> iterator_range<T> make_range(const T &x, const T &y) {
return (iterator_range<T>(x, y));
template <class T> iterator_range<T> make_range(T x, T y) {
return iterator_range<T>(std::move(x), std::move(y));
}
}