aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h
diff options
context:
space:
mode:
authorAndrey Khalyavin <halyavin@gmail.com>2022-04-15 02:46:40 +0300
committerAndrey Khalyavin <halyavin@gmail.com>2022-04-15 02:46:40 +0300
commitc5bfd90690e2df55f55d1831b0edd2e1c7241582 (patch)
treecda6bc446bf17fc110b67126b4c5ddc640fa427b /contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h
parent599463a2ac4bda8536564ec6d7b798447755f05f (diff)
downloadydb-c5bfd90690e2df55f55d1831b0edd2e1c7241582.tar.gz
Update libc++ to b6d87773 (14 Jan 2022).
Notable changes: * implement operator << for filesystem::directory_entry * add std::ranges::in_in_result * add std::ranges::owning_view * add std::ranges::cdata * add std::ranges::construct_at and destroy{,_n,_at} * small fixes in std::ranges::data * SFINAE away std::ranges::cbegin(const T&&) for non-borrowed T * use arc4random to implement std::random_device on Apple * introduce __fits_in_sso to put constexpr check into a central place * introduce __debug_db_insert_c to put #if and constexpr check into a central place ref:b3dd06bd52f06e8939227ca0f0a5873d0c211e48
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h
index bad23c8c4b..fa31074ab6 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__ranges/concepts.h
@@ -9,6 +9,9 @@
#ifndef _LIBCPP___RANGES_CONCEPTS_H
#define _LIBCPP___RANGES_CONCEPTS_H
+#include <__concepts/constructible.h>
+#include <__concepts/movable.h>
+#include <__concepts/same_as.h>
#include <__config>
#include <__iterator/concepts.h>
#include <__iterator/incrementable_traits.h>
@@ -20,7 +23,7 @@
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/enable_view.h>
#include <__ranges/size.h>
-#include <concepts>
+#include <initializer_list>
#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -114,12 +117,20 @@ namespace ranges {
template <class _Tp>
concept common_range = range<_Tp> && same_as<iterator_t<_Tp>, sentinel_t<_Tp>>;
- template<class _Tp>
+ template <class _Tp>
+ inline constexpr bool __is_std_initializer_list = false;
+
+ template <class _Ep>
+ inline constexpr bool __is_std_initializer_list<initializer_list<_Ep>> = true;
+
+ template <class _Tp>
concept viewable_range =
- range<_Tp> && (
- (view<remove_cvref_t<_Tp>> && constructible_from<remove_cvref_t<_Tp>, _Tp>) ||
- (!view<remove_cvref_t<_Tp>> && borrowed_range<_Tp>)
- );
+ range<_Tp> &&
+ ((view<remove_cvref_t<_Tp>> && constructible_from<remove_cvref_t<_Tp>, _Tp>) ||
+ (!view<remove_cvref_t<_Tp>> &&
+ (is_lvalue_reference_v<_Tp> ||
+ (movable<remove_reference_t<_Tp>> && !__is_std_initializer_list<remove_cvref_t<_Tp>>))));
+
} // namespace ranges
#endif // !defined(_LIBCPP_HAS_NO_RANGES)