aboutsummaryrefslogtreecommitdiff
path: root/include/iterator
diff options
context:
space:
mode:
authorDavid Chisnall <theraven@FreeBSD.org>2013-07-10 10:49:31 +0000
committerDavid Chisnall <theraven@FreeBSD.org>2013-07-10 10:49:31 +0000
commit1c9014238e909c768bf84564733b5441d5c9ea2b (patch)
treeee42ff7378fd2433cb88e1cfa25b2a65035b0c43 /include/iterator
parent527d9fcb66574fdd657c3235c0d7cba7c5439d5c (diff)
Notes
Diffstat (limited to 'include/iterator')
-rw-r--r--include/iterator9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/iterator b/include/iterator
index 3b078a2a214c..dda053da33bc 100644
--- a/include/iterator
+++ b/include/iterator
@@ -1135,7 +1135,14 @@ public:
#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