Zhihao Yuan noted that there were a few unneeded statements. Eliminated the unnecessary ones, and commented the ones that are there for non-obvious reasons such as to help things limp along in C++03 language mode.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189039 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/__hash_table b/include/__hash_table
index 880ef96..ae63518 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -2101,7 +2101,7 @@
__h.get_deleter().__value_constructed = true;
__h->__hash_ = __hash;
__h->__next_ = nullptr;
- return _VSTD::move(__h);
+ return __h;
}
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -2116,7 +2116,7 @@
__h.get_deleter().__value_constructed = true;
__h->__hash_ = hash_function()(__h->__value_);
__h->__next_ = nullptr;
- return _VSTD::move(__h);
+ return _VSTD::move(__h); // explicitly moved for C++03
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@@ -2132,7 +2132,7 @@
__h.get_deleter().__value_constructed = true;
__h->__hash_ = __hash;
__h->__next_ = nullptr;
- return _VSTD::move(__h);
+ return _VSTD::move(__h); // explicitly moved for C++03
}
template <class _Tp, class _Hash, class _Equal, class _Alloc>
diff --git a/include/__tree b/include/__tree
index 67f0a2b..acf8759 100644
--- a/include/__tree
+++ b/include/__tree
@@ -1854,7 +1854,7 @@
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
__node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
__h.get_deleter().__value_constructed = true;
- return _VSTD::move(__h);
+ return _VSTD::move(__h); // explicitly moved for C++03
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
diff --git a/include/algorithm b/include/algorithm
index 053b809..03b872a 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -829,7 +829,7 @@
{
for (; __first != __last; ++__first)
__f(*__first);
- return _VSTD::move(__f);
+ return _VSTD::move(__f); // explicitly moved for (emulated) C++03
}
// find
diff --git a/include/ext/hash_map b/include/ext/hash_map
index 3e474b0..b57ea53 100644
--- a/include/ext/hash_map
+++ b/include/ext/hash_map
@@ -684,7 +684,7 @@
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
__h.get_deleter().__second_constructed = true;
- return _VSTD::move(__h);
+ return _VSTD::move(__h); // explicitly moved for C++03
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
diff --git a/include/map b/include/map
index 6a80af5..5449d6c 100644
--- a/include/map
+++ b/include/map
@@ -1266,7 +1266,7 @@
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
__h.get_deleter().__second_constructed = true;
- return _VSTD::move(__h);
+ return __h;
}
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -1300,7 +1300,7 @@
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
__h.get_deleter().__second_constructed = true;
- return _VSTD::move(__h);
+ return _VSTD::move(__h); // explicitly moved for C++03
}
template <class _Key, class _Tp, class _Compare, class _Allocator>
diff --git a/include/unordered_map b/include/unordered_map
index 7b5bdb6..b53af14 100644
--- a/include/unordered_map
+++ b/include/unordered_map
@@ -1211,7 +1211,7 @@
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
__h.get_deleter().__second_constructed = true;
- return _VSTD::move(__h);
+ return __h;
}
#ifndef _LIBCPP_HAS_NO_VARIADICS
@@ -1258,7 +1258,7 @@
__h.get_deleter().__first_constructed = true;
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
__h.get_deleter().__second_constructed = true;
- return _VSTD::move(__h);
+ return _VSTD::move(__h); // explicitly moved for C++03
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>