aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__memory/allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__memory/allocator.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__memory/allocator.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/llvm-project/libcxx/include/__memory/allocator.h b/contrib/llvm-project/libcxx/include/__memory/allocator.h
index 54c9b78d524d..47e1ef926a4a 100644
--- a/contrib/llvm-project/libcxx/include/__memory/allocator.h
+++ b/contrib/llvm-project/libcxx/include/__memory/allocator.h
@@ -11,6 +11,7 @@
#define _LIBCPP___MEMORY_ALLOCATOR_H
#include <__config>
+#include <__memory/addressof.h>
#include <__memory/allocate_at_least.h>
#include <__memory/allocator_traits.h>
#include <__type_traits/is_constant_evaluated.h>
@@ -20,7 +21,6 @@
#include <__utility/forward.h>
#include <cstddef>
#include <new>
-#include <stdexcept>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -98,8 +98,7 @@ public:
typedef true_type propagate_on_container_move_assignment;
typedef true_type is_always_equal;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
- allocator() _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator() _NOEXCEPT = default;
template <class _Up>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -116,7 +115,7 @@ public:
}
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr
allocation_result<_Tp*> allocate_at_least(size_t __n) {
return {allocate(__n), __n};
@@ -187,8 +186,7 @@ public:
typedef true_type propagate_on_container_move_assignment;
typedef true_type is_always_equal;
- _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
- allocator() _NOEXCEPT = default;
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 allocator() _NOEXCEPT = default;
template <class _Up>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
@@ -205,7 +203,7 @@ public:
}
}
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER >= 23
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr
allocation_result<const _Tp*> allocate_at_least(size_t __n) {
return {allocate(__n), __n};
@@ -264,10 +262,14 @@ template <class _Tp, class _Up>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
bool operator==(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return true;}
+#if _LIBCPP_STD_VER <= 17
+
template <class _Tp, class _Up>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
+inline _LIBCPP_INLINE_VISIBILITY
bool operator!=(const allocator<_Tp>&, const allocator<_Up>&) _NOEXCEPT {return false;}
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___MEMORY_ALLOCATOR_H