From d8fc1ec894ac466b3f63b5ee818ac38869e76d41 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 17 May 2016 17:44:40 +0000 Subject: [PATCH] Implement LWG2576: istream_iterator and ostream_iterator should use std::addressof git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@269789 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/iterator | 8 ++++---- www/cxx1z_status.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/iterator b/include/iterator index 0e60aa9b3..9314d6ace 100644 --- a/include/iterator +++ b/include/iterator @@ -772,14 +772,14 @@ private: _Tp __value_; public: _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(0), __value_() {} - _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(&__s) + _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(_VSTD::addressof(__s)) { if (!(*__in_stream_ >> __value_)) __in_stream_ = 0; } _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;} - _LIBCPP_INLINE_VISIBILITY const _Tp* operator->() const {return &(operator*());} + _LIBCPP_INLINE_VISIBILITY const _Tp* operator->() const {return _VSTD::addressof((operator*()));} _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++() { if (!(*__in_stream_ >> __value_)) @@ -811,9 +811,9 @@ private: const char_type* __delim_; public: _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s) - : __out_stream_(&__s), __delim_(0) {} + : __out_stream_(_VSTD::addressof(__s)), __delim_(0) {} _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter) - : __out_stream_(&__s), __delim_(__delimiter) {} + : __out_stream_(_VSTD::addressof(__s)), __delim_(__delimiter) {} _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_) { *__out_stream_ << __value_; diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html index 3725c5c63..0f155d76b 100644 --- a/www/cxx1z_status.html +++ b/www/cxx1z_status.html @@ -222,7 +222,7 @@ 2572The remarks for shared_ptr::operator* should apply to cv-qualified void as wellJacksonvilleComplete 2574[fund.ts.v2] std::experimental::function::operator=(F&&) should be constrainedJacksonville 2575[fund.ts.v2] experimental::function::assign should be removedJacksonville - 2576istream_iterator and ostream_iterator should use std::addressofJacksonville + 2576istream_iterator and ostream_iterator should use std::addressofJacksonvilleComplete 2577{shared,unique}_lock should use std::addressofJacksonvilleComplete 2579Inconsistency wrt Allocators in basic_string assignment vs. basic_string::assignJacksonvilleComplete 2581Specialization of <type_traits> variable templates should be prohibitedJacksonvilleComplete