modules/emscripten/system/include/libcxx/iterator in webruby-0.1.1 vs modules/emscripten/system/include/libcxx/iterator in webruby-0.1.2
- old
+ new
@@ -319,12 +319,14 @@
#include <iosfwd>
#ifdef __APPLE__
#include <Availability.h>
#endif
-#ifdef _LIBCPP_DEBUG
-#include <cassert>
+#ifdef _LIBCPP_DEBUG2
+# include <__debug>
+#else
+# define _LIBCPP_ASSERT(x, m) ((void)0)
#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
@@ -1089,10 +1091,13 @@
typedef typename iterator_traits<iterator_type>::reference reference;
private:
iterator_type __i;
public:
_LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT
+#if _LIBCPP_STD_VER > 11
+ : __i{}
+#endif
{
#if _LIBCPP_DEBUG_LEVEL >= 2
__get_db()->__insert_i(this);
#endif
}
@@ -1133,11 +1138,18 @@
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to dereference a non-dereferenceable iterator");
#endif
return *__i;
}
- _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT {return &(operator*());}
+ _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT
+ {
+#if _LIBCPP_DEBUG_LEVEL >= 2
+ _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
+ "Attempted to dereference a non-dereferenceable iterator");
+#endif
+ return (pointer)&reinterpret_cast<const volatile char&>(*__i);
+ }
_LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT
{
#if _LIBCPP_DEBUG_LEVEL >= 2
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
"Attempted to increment non-incrementable iterator");
@@ -1255,24 +1267,20 @@
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
{
-#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
- "Attempted to compare incomparable iterators");
-#endif
return __x.base() == __y.base();
}
template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
{
#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
+ _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
"Attempted to compare incomparable iterators");
#endif
return __x.base() < __y.base();
}
@@ -1344,10 +1352,10 @@
inline _LIBCPP_INLINE_VISIBILITY
typename __wrap_iter<_Iter1>::difference_type
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
{
#if _LIBCPP_DEBUG_LEVEL >= 2
- _LIBCPP_ASSERT(__get_const_db()->__comparable(&__x, &__y),
+ _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
"Attempted to subtract incompatible iterators");
#endif
return __x.base() - __y.base();
}