summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/iterator
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-10-22 18:25:04 +0000
committerdim <dim@FreeBSD.org>2012-10-22 18:25:04 +0000
commit708d8e446e991358da23bb52ec5320440221f12f (patch)
tree3a061d75674cd5b60d9f6df45d0b8d755da3782f /contrib/libc++/include/iterator
parentb8c74d455d2690e710a0802a98a9d310995a52eb (diff)
parent13334223d751d249ccd6475b8cba36ff71ddc972 (diff)
downloadFreeBSD-src-708d8e446e991358da23bb52ec5320440221f12f.zip
FreeBSD-src-708d8e446e991358da23bb52ec5320440221f12f.tar.gz
Import libc++ trunk r165949. Among other improvements and bug fixes,
this has many visibility problems fixed, which should help with compiling certain ports that exercise C++11 mode (i.e. Firefox). Also, belatedly add the LICENSE.TXT and accompanying CREDITS.TXT files, which are referred to in all the source files. MFC after: 1 month
Diffstat (limited to 'contrib/libc++/include/iterator')
-rw-r--r--contrib/libc++/include/iterator93
1 files changed, 75 insertions, 18 deletions
diff --git a/contrib/libc++/include/iterator b/contrib/libc++/include/iterator
index 75fee4b..5747504 100644
--- a/contrib/libc++/include/iterator
+++ b/contrib/libc++/include/iterator
@@ -263,10 +263,10 @@ public:
typedef basic_streambuf<charT,traits> streambuf_type;
typedef basic_istream<charT,traits> istream_type;
- istreambuf_iterator() throw();
- istreambuf_iterator(istream_type& s) throw();
- istreambuf_iterator(streambuf_type* s) throw();
- istreambuf_iterator(a-private-type) throw();
+ istreambuf_iterator() noexcept;
+ istreambuf_iterator(istream_type& s) noexcept;
+ istreambuf_iterator(streambuf_type* s) noexcept;
+ istreambuf_iterator(a-private-type) noexcept;
charT operator*() const;
pointer operator->() const;
@@ -293,13 +293,13 @@ public:
typedef basic_streambuf<charT,traits> streambuf_type;
typedef basic_ostream<charT,traits> ostream_type;
- ostreambuf_iterator(ostream_type& s) throw();
- ostreambuf_iterator(streambuf_type* s) throw();
+ ostreambuf_iterator(ostream_type& s) noexcept;
+ ostreambuf_iterator(streambuf_type* s) noexcept;
ostreambuf_iterator& operator=(charT c);
ostreambuf_iterator& operator*();
ostreambuf_iterator& operator++();
ostreambuf_iterator& operator++(int);
- bool failed() const throw();
+ bool failed() const noexcept;
};
template <class C> auto begin(C& c) -> decltype(c.begin());
@@ -815,12 +815,12 @@ private:
__sbuf_ = 0;
}
public:
- _LIBCPP_INLINE_VISIBILITY istreambuf_iterator() throw() : __sbuf_(0) {}
- _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) throw()
+ _LIBCPP_INLINE_VISIBILITY istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {}
+ _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
: __sbuf_(__s.rdbuf()) {__test_for_eof();}
- _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) throw()
+ _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
: __sbuf_(__s) {__test_for_eof();}
- _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) throw()
+ _LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT
: __sbuf_(__p.__sbuf_) {}
_LIBCPP_INLINE_VISIBILITY char_type operator*() const
@@ -867,9 +867,9 @@ public:
private:
streambuf_type* __sbuf_;
public:
- _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(ostream_type& __s) throw()
+ _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(ostream_type& __s) _NOEXCEPT
: __sbuf_(__s.rdbuf()) {}
- _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(streambuf_type* __s) throw()
+ _LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(streambuf_type* __s) _NOEXCEPT
: __sbuf_(__s) {}
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)
{
@@ -880,7 +880,15 @@ public:
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;}
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;}
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}
- _LIBCPP_INLINE_VISIBILITY bool failed() const throw() {return __sbuf_ == 0;}
+ _LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;}
+
+ template <class _Ch, class _Tr>
+ friend
+ _LIBCPP_HIDDEN
+ ostreambuf_iterator<_Ch, _Tr>
+ __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s,
+ const _Ch* __ob, const _Ch* __op, const _Ch* __oe,
+ ios_base& __iob, _Ch __fl);
};
template <class _Iter>
@@ -1009,43 +1017,52 @@ make_move_iterator(const _Iter& __i)
template <class _Iter> class __wrap_iter;
template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
template <class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
typename __wrap_iter<_Iter1>::difference_type
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
template <class _Iter>
+_LIBCPP_INLINE_VISIBILITY
__wrap_iter<_Iter>
operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT;
-template <class _Ip, class _Op> _Op copy(_Ip, _Ip, _Op);
-template <class _B1, class _B2> _B2 copy_backward(_B1, _B1, _B2);
-template <class _Ip, class _Op> _Op move(_Ip, _Ip, _Op);
-template <class _B1, class _B2> _B2 move_backward(_B1, _B1, _B2);
+template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY copy(_Ip, _Ip, _Op);
+template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY copy_backward(_B1, _B1, _B2);
+template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY move(_Ip, _Ip, _Op);
+template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, _B1, _B2);
template <class _Tp>
+_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
is_trivially_copy_assignable<_Tp>::value,
@@ -1284,6 +1301,38 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
return !(__y < __x);
}
+template <class _Iter1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+{
+ return !(__x == __y);
+}
+
+template <class _Iter1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+{
+ return __y < __x;
+}
+
+template <class _Iter1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+{
+ return !(__x < __y);
+}
+
+template <class _Iter1>
+inline _LIBCPP_INLINE_VISIBILITY
+bool
+operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
+{
+ return !(__y < __x);
+}
+
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
typename __wrap_iter<_Iter1>::difference_type
@@ -1313,34 +1362,42 @@ operator+(typename __wrap_iter<_Iter>::difference_type __n,
template <class _Container, class _Iter> class __debug_iter;
template <class _Container, class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator==(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
template <class _Container, class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator<(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
template <class _Container, class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator!=(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
template <class _Container, class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator>(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
template <class _Container, class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator>=(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
template <class _Container, class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
bool
operator<=(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
template <class _Container, class _Iter1, class _Iter2>
+_LIBCPP_INLINE_VISIBILITY
typename __debug_iter<_Container, _Iter1>::difference_type
operator-(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
template <class _Container, class _Iter>
+_LIBCPP_INLINE_VISIBILITY
__debug_iter<_Container, _Iter>
operator+(typename __debug_iter<_Container, _Iter>::difference_type, const __debug_iter<_Container, _Iter>&);
OpenPOWER on IntegriCloud