diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2016-05-17 17:44:40 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2016-05-17 17:44:40 +0000 |
| commit | bc6a7df0726fd6a5857da83a980aa88ac28fa13b (patch) | |
| tree | df1263e233e86c9fce5cc1c760bca6cc4aff8734 /libcxx/include/iterator | |
| parent | 5e9944ee0a65b85c54810b9899a9450a4f9c5c36 (diff) | |
| download | bcm5719-llvm-bc6a7df0726fd6a5857da83a980aa88ac28fa13b.tar.gz bcm5719-llvm-bc6a7df0726fd6a5857da83a980aa88ac28fa13b.zip | |
Implement LWG2576: istream_iterator and ostream_iterator should use std::addressof
llvm-svn: 269789
Diffstat (limited to 'libcxx/include/iterator')
| -rw-r--r-- | libcxx/include/iterator | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libcxx/include/iterator b/libcxx/include/iterator index 0e60aa9b38b..9314d6ace26 100644 --- a/libcxx/include/iterator +++ b/libcxx/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_; |

