From 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 6 Sep 2015 18:46:46 +0000 Subject: Import libc++ 3.7.0 release (r246257). --- include/iterator | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'include/iterator') diff --git a/include/iterator b/include/iterator index bcf142a6c833..c06ef8f6777d 100644 --- a/include/iterator +++ b/include/iterator @@ -214,7 +214,7 @@ public: typedef traits traits_type; typedef basic_istream istream_type; - istream_iterator(); + constexpr istream_iterator(); istream_iterator(istream_type& s); istream_iterator(const istream_iterator& x); ~istream_iterator(); @@ -575,7 +575,7 @@ public: _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator-=(difference_type __n) {current += __n; return *this;} _LIBCPP_INLINE_VISIBILITY reference operator[](difference_type __n) const - {return current[-__n-1];} + {return *(*this + __n);} }; template @@ -765,7 +765,7 @@ private: istream_type* __in_stream_; _Tp __value_; public: - _LIBCPP_INLINE_VISIBILITY istream_iterator() : __in_stream_(0) {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR istream_iterator() : __in_stream_(0), __value_() {} _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(&__s) { if (!(*__in_stream_ >> __value_)) @@ -1241,7 +1241,7 @@ private: template friend class __wrap_iter; template friend class basic_string; - template friend class vector; + template friend class _LIBCPP_TYPE_VIS_ONLY vector; template friend @@ -1580,29 +1580,29 @@ end(const _Cp& __c) #endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN) #if _LIBCPP_STD_VER > 14 -template -constexpr auto size(const _C& __c) -> decltype(__c.size()) { return __c.size(); } +template +constexpr auto size(const _Cont& __c) -> decltype(__c.size()) { return __c.size(); } -template -constexpr size_t size(const _Tp (&__array)[_N]) noexcept { return _N; } +template +constexpr size_t size(const _Tp (&__array)[_Sz]) noexcept { return _Sz; } -template -constexpr auto empty(const _C& __c) -> decltype(__c.empty()) { return __c.empty(); } +template +constexpr auto empty(const _Cont& __c) -> decltype(__c.empty()) { return __c.empty(); } -template -constexpr bool empty(const _Tp (&__array)[_N]) noexcept { return false; } +template +constexpr bool empty(const _Tp (&__array)[_Sz]) noexcept { return false; } template constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; } -template constexpr -auto data(_C& __c) -> decltype(__c.data()) { return __c.data(); } +template constexpr +auto data(_Cont& __c) -> decltype(__c.data()) { return __c.data(); } -template constexpr -auto data(const _C& __c) -> decltype(__c.data()) { return __c.data(); } +template constexpr +auto data(const _Cont& __c) -> decltype(__c.data()) { return __c.data(); } -template -constexpr _Tp* data(_Tp (&__array)[_N]) noexcept { return __array; } +template +constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept { return __array; } template constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept { return __il.begin(); } -- cgit v1.3