aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h
diff options
context:
space:
mode:
authormikhnenko <mikhnenko@yandex-team.com>2024-03-27 10:35:27 +0300
committermikhnenko <mikhnenko@yandex-team.com>2024-03-27 10:47:39 +0300
commit9b902baa4a858f2176c82aa0b20f88232f0da0d8 (patch)
tree7165a551c2244c4b3c28479ac3a3f6d62346ec89 /contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h
parenta1c989e67e438005fa0c34ed0e910536c8941862 (diff)
downloadydb-9b902baa4a858f2176c82aa0b20f88232f0da0d8.tar.gz
Update libcxx to 10 Oct 2023 dc129d6f715cf83a2072fc8de8b4e4c70bca6935
97ce40d276e44357a49b7a945af841896126dca8
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h b/contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h
index 00c2928dcc..bce00bf02a 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__memory/assume_aligned.h
@@ -22,16 +22,12 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if _LIBCPP_STD_VER >= 20
-
template <size_t _Np, class _Tp>
-[[nodiscard]]
-_LIBCPP_HIDE_FROM_ABI
-constexpr _Tp* assume_aligned(_Tp* __ptr) {
+_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __assume_aligned(_Tp* __ptr) {
static_assert(_Np != 0 && (_Np & (_Np - 1)) == 0,
"std::assume_aligned<N>(p) requires N to be a power of two");
- if (is_constant_evaluated()) {
+ if (__libcpp_is_constant_evaluated()) {
return __ptr;
} else {
_LIBCPP_ASSERT_UNCATEGORIZED(reinterpret_cast<uintptr_t>(__ptr) % _Np == 0, "Alignment assumption is violated");
@@ -39,6 +35,13 @@ constexpr _Tp* assume_aligned(_Tp* __ptr) {
}
}
+#if _LIBCPP_STD_VER >= 20
+
+template <size_t _Np, class _Tp>
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp* assume_aligned(_Tp* __ptr) {
+ return std::__assume_aligned<_Np>(__ptr);
+}
+
#endif // _LIBCPP_STD_VER >= 20
_LIBCPP_END_NAMESPACE_STD