Avoid bugprone-move-forwarding-reference warning in Clang (#4560)

Use std::forward<T> instead of std::move, on an argument with
rvalue-reference of template-deduced type.

See https://clang.llvm.org/extra/clang-tidy/checks/bugprone-move-forwarding-reference.html

Bug: crbug.com/1134310
This commit is contained in:
David Neto 2021-10-06 16:50:16 -04:00 committed by GitHub
parent 0c4deebc96
commit b46995741b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,7 +142,7 @@ inline IteratorRange<IteratorType> make_range(const IteratorType& begin,
template <typename IteratorType>
inline IteratorRange<IteratorType> make_range(IteratorType&& begin,
IteratorType&& end) {
return {std::move(begin), std::move(end)};
return {std::forward<IteratorType>(begin), std::forward<IteratorType>(end)};
}
// Returns a (begin, end) iterator pair for the given container.