Fix LWG issue #2106: move_iterators returning prvalues

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267091 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2016-04-22 00:49:12 +00:00
parent 6f367f088c
commit df46b78ce7
3 changed files with 47 additions and 3 deletions

View File

@@ -951,7 +951,12 @@ public:
typedef typename iterator_traits<iterator_type>::difference_type difference_type;
typedef iterator_type pointer;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
typedef value_type&& reference;
typedef typename iterator_traits<iterator_type>::reference __reference;
typedef typename conditional<
is_reference<__reference>::value,
typename remove_reference<__reference>::type&&,
__reference
>::type reference;
#else
typedef typename iterator_traits<iterator_type>::reference reference;
#endif