summaryrefslogtreecommitdiffstats
path: root/libcxx/include/iterator
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-06-27 19:35:32 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-06-27 19:35:32 +0000
commit3ec1f00b733700a73adda3140e1ca2af551903d6 (patch)
tree080816321602b7bf58f0e237d15dad98f0fb6343 /libcxx/include/iterator
parent161381e12076cbeb45e0c7481e68d54fe8553eb0 (diff)
downloadbcm5719-llvm-3ec1f00b733700a73adda3140e1ca2af551903d6.tar.gz
bcm5719-llvm-3ec1f00b733700a73adda3140e1ca2af551903d6.zip
Implement full support for non-pointer pointers in custom allocators for vector.
llvm-svn: 185093
Diffstat (limited to 'libcxx/include/iterator')
-rw-r--r--libcxx/include/iterator9
1 files changed, 8 insertions, 1 deletions
diff --git a/libcxx/include/iterator b/libcxx/include/iterator
index 3b078a2a214..dda053da33b 100644
--- a/libcxx/include/iterator
+++ b/libcxx/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
OpenPOWER on IntegriCloud