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
This commit is contained in:
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user