aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.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/__algorithm/clamp.h
parenta1c989e67e438005fa0c34ed0e910536c8941862 (diff)
downloadydb-9b902baa4a858f2176c82aa0b20f88232f0da0d8.tar.gz
Update libcxx to 10 Oct 2023 dc129d6f715cf83a2072fc8de8b4e4c70bca6935
97ce40d276e44357a49b7a945af841896126dca8
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h b/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h
index 31deb4fd94..fc08827919 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__algorithm/clamp.h
@@ -20,24 +20,22 @@
_LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER >= 17
-template<class _Tp, class _Compare>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY constexpr
-const _Tp&
-clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp)
-{
- _LIBCPP_ASSERT_UNCATEGORIZED(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
- return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;
-
+template <class _Tp, class _Compare>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
+clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
+ _LIBCPP_LIFETIMEBOUND const _Tp& __lo,
+ _LIBCPP_LIFETIMEBOUND const _Tp& __hi,
+ _Compare __comp) {
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
+ return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;
}
-template<class _Tp>
-_LIBCPP_NODISCARD_EXT inline
-_LIBCPP_INLINE_VISIBILITY constexpr
-const _Tp&
-clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi)
-{
- return _VSTD::clamp(__v, __lo, __hi, __less<>());
+template <class _Tp>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI constexpr const _Tp&
+clamp(_LIBCPP_LIFETIMEBOUND const _Tp& __v,
+ _LIBCPP_LIFETIMEBOUND const _Tp& __lo,
+ _LIBCPP_LIFETIMEBOUND const _Tp& __hi) {
+ return _VSTD::clamp(__v, __lo, __hi, __less<>());
}
#endif