LWG issue #2188: Reverse iterator does not fully support targets that overload operator&. Also mark #2272 and #2299 as complete; libc++ already implements them.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2014-02-27 02:11:50 +00:00
parent ec7009afe8
commit 02ca8af10b
3 changed files with 44 additions and 4 deletions

View File

@@ -327,6 +327,7 @@ template <class C> auto crend(const C& c) -> decltype(std::rend(c)); //
*/
#include <__config>
#include <__functional_base>
#include <type_traits>
#include <cstddef>
#include <iosfwd>
@@ -549,7 +550,7 @@ public:
: __t(__u.base()), current(__u.base()) {}
_LIBCPP_INLINE_VISIBILITY _Iter base() const {return current;}
_LIBCPP_INLINE_VISIBILITY reference operator*() const {__t = current; return *--__t;}
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return &(operator*());}
_LIBCPP_INLINE_VISIBILITY pointer operator->() const {return _VSTD::addressof(operator*());}
_LIBCPP_INLINE_VISIBILITY reverse_iterator& operator++() {--current; return *this;}
_LIBCPP_INLINE_VISIBILITY reverse_iterator operator++(int)
{reverse_iterator __tmp(*this); --current; return __tmp;}