|
@@ -619,6 +619,46 @@ addressof(_Tp& __x) _NOEXCEPT
|
|
|
return (_Tp*)&(char&)__x;
|
|
|
}
|
|
|
|
|
|
+#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
|
|
|
+// Objective-C++ Automatic Reference Counting uses qualified pointers
|
|
|
+// that require special addressof() signatures. When
|
|
|
+// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
|
|
|
+// itself is providing these definitions. Otherwise, we provide them.
|
|
|
+template <class _Tp>
|
|
|
+inline _LIBCPP_INLINE_VISIBILITY
|
|
|
+__strong _Tp*
|
|
|
+addressof(__strong _Tp& __x) _NOEXCEPT
|
|
|
+{
|
|
|
+ return &__x;
|
|
|
+}
|
|
|
+
|
|
|
+#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
|
|
|
+template <class _Tp>
|
|
|
+inline _LIBCPP_INLINE_VISIBILITY
|
|
|
+__weak _Tp*
|
|
|
+addressof(__weak _Tp& __x) _NOEXCEPT
|
|
|
+{
|
|
|
+ return &__x;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+template <class _Tp>
|
|
|
+inline _LIBCPP_INLINE_VISIBILITY
|
|
|
+__autoreleasing _Tp*
|
|
|
+addressof(__autoreleasing _Tp& __x) _NOEXCEPT
|
|
|
+{
|
|
|
+ return &__x;
|
|
|
+}
|
|
|
+
|
|
|
+template <class _Tp>
|
|
|
+inline _LIBCPP_INLINE_VISIBILITY
|
|
|
+__unsafe_unretained _Tp*
|
|
|
+addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
|
|
|
+{
|
|
|
+ return &__x;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
template <class _Tp> class allocator;
|
|
|
|
|
|
template <>
|