diff options
| author | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
|---|---|---|
| committer | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
| commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
| tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /contrib/libs/cxxsupp/libcxx/include | |
| parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
fix ya.make
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include')
68 files changed, 0 insertions, 12958 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__config_site.in b/contrib/libs/cxxsupp/libcxx/include/__config_site.in deleted file mode 100644 index a1a08a5ee02..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__config_site.in +++ /dev/null @@ -1,39 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_CONFIG_SITE -#define _LIBCPP_CONFIG_SITE - -#cmakedefine _LIBCPP_ABI_VERSION @_LIBCPP_ABI_VERSION@ -#cmakedefine _LIBCPP_ABI_NAMESPACE @_LIBCPP_ABI_NAMESPACE@ -#cmakedefine _LIBCPP_ABI_FORCE_ITANIUM -#cmakedefine _LIBCPP_ABI_FORCE_MICROSOFT -#cmakedefine _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT -#cmakedefine _LIBCPP_HAS_NO_THREADS -#cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK -#cmakedefine _LIBCPP_HAS_MUSL_LIBC -#cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD -#cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL -#cmakedefine _LIBCPP_HAS_THREAD_API_WIN32 -#cmakedefine _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL -#cmakedefine _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -#cmakedefine _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS -#cmakedefine _LIBCPP_NO_VCRUNTIME -#cmakedefine _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION @_LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION@ -#cmakedefine _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY -#cmakedefine _LIBCPP_HAS_PARALLEL_ALGORITHMS -#cmakedefine _LIBCPP_HAS_NO_RANDOM_DEVICE -#cmakedefine _LIBCPP_HAS_NO_LOCALIZATION -#cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS -#cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_FORMAT -#cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_RANGES - -@_LIBCPP_ABI_DEFINES@ -@_LIBCPP_EXTRA_SITE_DEFINES@ - -#endif // _LIBCPP_CONFIG_SITE diff --git a/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_handle.h b/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_handle.h deleted file mode 100644 index ad399c86f8b..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_handle.h +++ /dev/null @@ -1,202 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___COROUTINE_COROUTINE_HANDLE_H -#define _LIBCPP___COROUTINE_COROUTINE_HANDLE_H - -#include <__config> -#include <__debug> -#include <__functional/hash.h> -#include <__memory/addressof.h> -#include <compare> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) - -_LIBCPP_BEGIN_NAMESPACE_STD - -// [coroutine.handle] -template <class _Promise = void> -struct _LIBCPP_TEMPLATE_VIS coroutine_handle; - -template <> -struct _LIBCPP_TEMPLATE_VIS coroutine_handle<void> { -public: - // [coroutine.handle.con], construct/reset - _LIBCPP_HIDE_FROM_ABI - constexpr coroutine_handle() noexcept = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr coroutine_handle(nullptr_t) noexcept {} - - _LIBCPP_HIDE_FROM_ABI - coroutine_handle& operator=(nullptr_t) noexcept { - __handle_ = nullptr; - return *this; - } - - // [coroutine.handle.export.import], export/import - _LIBCPP_HIDE_FROM_ABI - constexpr void* address() const noexcept { return __handle_; } - - _LIBCPP_HIDE_FROM_ABI - static constexpr coroutine_handle from_address(void* __addr) noexcept { - coroutine_handle __tmp; - __tmp.__handle_ = __addr; - return __tmp; - } - - // [coroutine.handle.observers], observers - _LIBCPP_HIDE_FROM_ABI - constexpr explicit operator bool() const noexcept { - return __handle_ != nullptr; - } - - _LIBCPP_HIDE_FROM_ABI - bool done() const { - _LIBCPP_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines"); - return __builtin_coro_done(__handle_); - } - - // [coroutine.handle.resumption], resumption - _LIBCPP_HIDE_FROM_ABI - void operator()() const { resume(); } - - _LIBCPP_HIDE_FROM_ABI - void resume() const { - _LIBCPP_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines"); - _LIBCPP_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done"); - __builtin_coro_resume(__handle_); - } - - _LIBCPP_HIDE_FROM_ABI - void destroy() const { - _LIBCPP_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines"); - __builtin_coro_destroy(__handle_); - } - -private: - bool __is_suspended() const { - // FIXME actually implement a check for if the coro is suspended. - return __handle_ != nullptr; - } - - void* __handle_ = nullptr; -}; - -// [coroutine.handle.compare] -inline _LIBCPP_HIDE_FROM_ABI -constexpr bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) noexcept { - return __x.address() == __y.address(); -} -inline _LIBCPP_HIDE_FROM_ABI -constexpr strong_ordering operator<=>(coroutine_handle<> __x, coroutine_handle<> __y) noexcept { - return compare_three_way()(__x.address(), __y.address()); -} - -template <class _Promise> -struct _LIBCPP_TEMPLATE_VIS coroutine_handle { -public: - // [coroutine.handle.con], construct/reset - _LIBCPP_HIDE_FROM_ABI - constexpr coroutine_handle() noexcept = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr coroutine_handle(nullptr_t) noexcept {} - - _LIBCPP_HIDE_FROM_ABI - static coroutine_handle from_promise(_Promise& __promise) { - using _RawPromise = typename remove_cv<_Promise>::type; - coroutine_handle __tmp; - __tmp.__handle_ = - __builtin_coro_promise(_VSTD::addressof(const_cast<_RawPromise&>(__promise)), alignof(_Promise), true); - return __tmp; - } - - _LIBCPP_HIDE_FROM_ABI - coroutine_handle& operator=(nullptr_t) noexcept { - __handle_ = nullptr; - return *this; - } - - // [coroutine.handle.export.import], export/import - _LIBCPP_HIDE_FROM_ABI - constexpr void* address() const noexcept { return __handle_; } - - _LIBCPP_HIDE_FROM_ABI - static constexpr coroutine_handle from_address(void* __addr) noexcept { - coroutine_handle __tmp; - __tmp.__handle_ = __addr; - return __tmp; - } - - // [coroutine.handle.conv], conversion - _LIBCPP_HIDE_FROM_ABI - constexpr operator coroutine_handle<>() const noexcept { - return coroutine_handle<>::from_address(address()); - } - - // [coroutine.handle.observers], observers - _LIBCPP_HIDE_FROM_ABI - constexpr explicit operator bool() const noexcept { - return __handle_ != nullptr; - } - - _LIBCPP_HIDE_FROM_ABI - bool done() const { - _LIBCPP_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines"); - return __builtin_coro_done(__handle_); - } - - // [coroutine.handle.resumption], resumption - _LIBCPP_HIDE_FROM_ABI - void operator()() const { resume(); } - - _LIBCPP_HIDE_FROM_ABI - void resume() const { - _LIBCPP_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines"); - _LIBCPP_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done"); - __builtin_coro_resume(__handle_); - } - - _LIBCPP_HIDE_FROM_ABI - void destroy() const { - _LIBCPP_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines"); - __builtin_coro_destroy(__handle_); - } - - // [coroutine.handle.promise], promise access - _LIBCPP_HIDE_FROM_ABI - _Promise& promise() const { - return *static_cast<_Promise*>(__builtin_coro_promise(this->__handle_, alignof(_Promise), false)); - } - -private: - bool __is_suspended() const { - // FIXME actually implement a check for if the coro is suspended. - return __handle_ != nullptr; - } - void* __handle_ = nullptr; -}; - -// [coroutine.handle.hash] -template <class _Tp> -struct hash<coroutine_handle<_Tp>> { - _LIBCPP_HIDE_FROM_ABI - size_t operator()(const coroutine_handle<_Tp>& __v) const noexcept { return hash<void*>()(__v.address()); } -}; - -_LIBCPP_END_NAMESPACE_STD - -#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) - -#endif // _LIBCPP___COROUTINE_COROUTINE_HANDLE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_traits.h b/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_traits.h deleted file mode 100644 index 0a5229b4594..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__coroutine/coroutine_traits.h +++ /dev/null @@ -1,53 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___COROUTINE_COROUTINE_TRAITS_H -#define _LIBCPP___COROUTINE_COROUTINE_TRAITS_H - -#include <__config> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) - -_LIBCPP_BEGIN_NAMESPACE_STD - -// [coroutine.traits] -// [coroutine.traits.primary] -// The header <coroutine> defined the primary template coroutine_traits such that -// if ArgTypes is a parameter pack of types and if the qualified-id R::promise_type -// is valid and denotes a type ([temp.deduct]), then coroutine_traits<R, ArgTypes...> -// has the following publicly accessible memebr: -// -// using promise_type = typename R::promise_type; -// -// Otherwise, coroutine_traits<R, ArgTypes...> has no members. -template <class _Tp, class = void> -struct __coroutine_traits_sfinae {}; - -template <class _Tp> -struct __coroutine_traits_sfinae< - _Tp, typename __void_t<typename _Tp::promise_type>::type> -{ - using promise_type = typename _Tp::promise_type; -}; - -template <class _Ret, class... _Args> -struct coroutine_traits - : public __coroutine_traits_sfinae<_Ret> -{ -}; - -_LIBCPP_END_NAMESPACE_STD - -#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) - -#endif // _LIBCPP___COROUTINE_COROUTINE_TRAITS_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__coroutine/noop_coroutine_handle.h b/contrib/libs/cxxsupp/libcxx/include/__coroutine/noop_coroutine_handle.h deleted file mode 100644 index 7a2c672057c..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__coroutine/noop_coroutine_handle.h +++ /dev/null @@ -1,112 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H -#define _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H - -#include <__config> -#include <__coroutine/coroutine_handle.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if __has_builtin(__builtin_coro_noop) || defined(_LIBCPP_COMPILER_GCC) - -// [coroutine.noop] -// [coroutine.promise.noop] -struct noop_coroutine_promise {}; - -// [coroutine.handle.noop] -template <> -struct _LIBCPP_TEMPLATE_VIS coroutine_handle<noop_coroutine_promise> { -public: - // [coroutine.handle.noop.conv], conversion - _LIBCPP_HIDE_FROM_ABI - constexpr operator coroutine_handle<>() const noexcept { - return coroutine_handle<>::from_address(address()); - } - - // [coroutine.handle.noop.observers], observers - _LIBCPP_HIDE_FROM_ABI - constexpr explicit operator bool() const noexcept { return true; } - _LIBCPP_HIDE_FROM_ABI - constexpr bool done() const noexcept { return false; } - - // [coroutine.handle.noop.resumption], resumption - _LIBCPP_HIDE_FROM_ABI - constexpr void operator()() const noexcept {} - _LIBCPP_HIDE_FROM_ABI - constexpr void resume() const noexcept {} - _LIBCPP_HIDE_FROM_ABI - constexpr void destroy() const noexcept {} - - // [coroutine.handle.noop.promise], promise access - _LIBCPP_HIDE_FROM_ABI - noop_coroutine_promise& promise() const noexcept { - return *static_cast<noop_coroutine_promise*>( - __builtin_coro_promise(this->__handle_, alignof(noop_coroutine_promise), false)); - } - - // [coroutine.handle.noop.address], address - _LIBCPP_HIDE_FROM_ABI - constexpr void* address() const noexcept { return __handle_; } - -private: - _LIBCPP_HIDE_FROM_ABI - friend coroutine_handle<noop_coroutine_promise> noop_coroutine() noexcept; - -#if __has_builtin(__builtin_coro_noop) - _LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept { - this->__handle_ = __builtin_coro_noop(); - } - - void* __handle_ = nullptr; - -#elif defined(_LIBCPP_COMPILER_GCC) - // GCC doesn't implement __builtin_coro_noop(). - // Construct the coroutine frame manually instead. - struct __noop_coroutine_frame_ty_ { - static void __dummy_resume_destroy_func() { } - - void (*__resume_)() = __dummy_resume_destroy_func; - void (*__destroy_)() = __dummy_resume_destroy_func; - struct noop_coroutine_promise __promise_; - }; - - static __noop_coroutine_frame_ty_ __noop_coroutine_frame_; - - void* __handle_ = &__noop_coroutine_frame_; - - _LIBCPP_HIDE_FROM_ABI coroutine_handle() noexcept = default; - -#endif // __has_builtin(__builtin_coro_noop) -}; - -using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>; - -#if defined(_LIBCPP_COMPILER_GCC) -inline noop_coroutine_handle::__noop_coroutine_frame_ty_ - noop_coroutine_handle::__noop_coroutine_frame_{}; -#endif - -// [coroutine.noop.coroutine] -inline _LIBCPP_HIDE_FROM_ABI -noop_coroutine_handle noop_coroutine() noexcept { return noop_coroutine_handle(); } - -#endif // __has_builtin(__builtin_coro_noop) || defined(_LIBCPP_COMPILER_GCC) - -_LIBCPP_END_NAMESPACE_STD - -#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) - -#endif // _LIBCPP___COROUTINE_NOOP_COROUTINE_HANDLE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__coroutine/trivial_awaitables.h b/contrib/libs/cxxsupp/libcxx/include/__coroutine/trivial_awaitables.h deleted file mode 100644 index 31399ab29a0..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__coroutine/trivial_awaitables.h +++ /dev/null @@ -1,46 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H -#define __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H - -#include <__config> -#include <__coroutine/coroutine_handle.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) - -_LIBCPP_BEGIN_NAMESPACE_STD - -// [coroutine.trivial.awaitables] -struct suspend_never { - _LIBCPP_HIDE_FROM_ABI - constexpr bool await_ready() const noexcept { return true; } - _LIBCPP_HIDE_FROM_ABI - constexpr void await_suspend(coroutine_handle<>) const noexcept {} - _LIBCPP_HIDE_FROM_ABI - constexpr void await_resume() const noexcept {} -}; - -struct suspend_always { - _LIBCPP_HIDE_FROM_ABI - constexpr bool await_ready() const noexcept { return false; } - _LIBCPP_HIDE_FROM_ABI - constexpr void await_suspend(coroutine_handle<>) const noexcept {} - _LIBCPP_HIDE_FROM_ABI - constexpr void await_resume() const noexcept {} -}; - -_LIBCPP_END_NAMESPACE_STD - -#endif // __LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX20_COROUTINES) - -#endif // __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__libcpp_version b/contrib/libs/cxxsupp/libcxx/include/__libcpp_version deleted file mode 100644 index 9e7036918f2..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__libcpp_version +++ /dev/null @@ -1 +0,0 @@ -15000 diff --git a/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_safety.h b/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_safety.h deleted file mode 100644 index e72080393dc..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__memory/pointer_safety.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___MEMORY_POINTER_SAFETY_H -#define _LIBCPP___MEMORY_POINTER_SAFETY_H - -#include <__config> -#include <cstddef> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_CXX03_LANG) - -enum class pointer_safety : unsigned char { - relaxed, - preferred, - strict -}; - -inline _LIBCPP_INLINE_VISIBILITY -pointer_safety get_pointer_safety() _NOEXCEPT { - return pointer_safety::relaxed; -} - -_LIBCPP_FUNC_VIS void declare_reachable(void* __p); -_LIBCPP_FUNC_VIS void declare_no_pointers(char* __p, size_t __n); -_LIBCPP_FUNC_VIS void undeclare_no_pointers(char* __p, size_t __n); -_LIBCPP_FUNC_VIS void* __undeclare_reachable(void* __p); - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -_Tp* -undeclare_reachable(_Tp* __p) -{ - return static_cast<_Tp*>(__undeclare_reachable(__p)); -} - -#endif // !C++03 - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___MEMORY_POINTER_SAFETY_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h deleted file mode 100644 index 54916fd476f..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/all.h +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_ALL_H -#define _LIBCPP___RANGES_ALL_H - -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/iterator_traits.h> -#include <__ranges/access.h> -#include <__ranges/concepts.h> -#include <__ranges/owning_view.h> -#include <__ranges/range_adaptor.h> -#include <__ranges/ref_view.h> -#include <__utility/auto_cast.h> -#include <__utility/declval.h> -#include <__utility/forward.h> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges::views { - -namespace __all { - struct __fn : __range_adaptor_closure<__fn> { - template<class _Tp> - requires ranges::view<decay_t<_Tp>> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(_LIBCPP_AUTO_CAST(std::forward<_Tp>(__t)))) - { - return _LIBCPP_AUTO_CAST(std::forward<_Tp>(__t)); - } - - template<class _Tp> - requires (!ranges::view<decay_t<_Tp>>) && - requires (_Tp&& __t) { ranges::ref_view{std::forward<_Tp>(__t)}; } - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::ref_view{std::forward<_Tp>(__t)})) - { - return ranges::ref_view{std::forward<_Tp>(__t)}; - } - - template<class _Tp> - requires (!ranges::view<decay_t<_Tp>> && - !requires (_Tp&& __t) { ranges::ref_view{std::forward<_Tp>(__t)}; } && - requires (_Tp&& __t) { ranges::owning_view{std::forward<_Tp>(__t)}; }) - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::owning_view{std::forward<_Tp>(__t)})) - { - return ranges::owning_view{std::forward<_Tp>(__t)}; - } - }; -} // namespace __all - -inline namespace __cpo { - inline constexpr auto all = __all::__fn{}; -} // namespace __cpo - -template<ranges::viewable_range _Range> -using all_t = decltype(views::all(declval<_Range>())); - -} // namespace ranges::views - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_ALL_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h deleted file mode 100644 index 3f58dafeb0e..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/common_view.h +++ /dev/null @@ -1,135 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_COMMON_VIEW_H -#define _LIBCPP___RANGES_COMMON_VIEW_H - -#include <__config> -#include <__iterator/common_iterator.h> -#include <__iterator/iterator_traits.h> -#include <__ranges/access.h> -#include <__ranges/all.h> -#include <__ranges/concepts.h> -#include <__ranges/enable_borrowed_range.h> -#include <__ranges/range_adaptor.h> -#include <__ranges/size.h> -#include <__ranges/view_interface.h> -#include <__utility/forward.h> -#include <__utility/move.h> -#include <concepts> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - -template<view _View> - requires (!common_range<_View> && copyable<iterator_t<_View>>) -class common_view : public view_interface<common_view<_View>> { - _View __base_ = _View(); - -public: - _LIBCPP_HIDE_FROM_ABI - common_view() requires default_initializable<_View> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit common_view(_View __v) : __base_(std::move(__v)) { } - - _LIBCPP_HIDE_FROM_ABI - constexpr _View base() const& requires copy_constructible<_View> { return __base_; } - - _LIBCPP_HIDE_FROM_ABI - constexpr _View base() && { return std::move(__base_); } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto begin() { - if constexpr (random_access_range<_View> && sized_range<_View>) - return ranges::begin(__base_); - else - return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::begin(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto begin() const requires range<const _View> { - if constexpr (random_access_range<const _View> && sized_range<const _View>) - return ranges::begin(__base_); - else - return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::begin(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto end() { - if constexpr (random_access_range<_View> && sized_range<_View>) - return ranges::begin(__base_) + ranges::size(__base_); - else - return common_iterator<iterator_t<_View>, sentinel_t<_View>>(ranges::end(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto end() const requires range<const _View> { - if constexpr (random_access_range<const _View> && sized_range<const _View>) - return ranges::begin(__base_) + ranges::size(__base_); - else - return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::end(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() requires sized_range<_View> { - return ranges::size(__base_); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() const requires sized_range<const _View> { - return ranges::size(__base_); - } -}; - -template<class _Range> -common_view(_Range&&) - -> common_view<views::all_t<_Range>>; - -template<class _View> -inline constexpr bool enable_borrowed_range<common_view<_View>> = enable_borrowed_range<_View>; - -namespace views { -namespace __common { - struct __fn : __range_adaptor_closure<__fn> { - template<class _Range> - requires common_range<_Range> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Range&& __range) const - noexcept(noexcept(views::all(std::forward<_Range>(__range)))) - -> decltype( views::all(std::forward<_Range>(__range))) - { return views::all(std::forward<_Range>(__range)); } - - template<class _Range> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Range&& __range) const - noexcept(noexcept(common_view{std::forward<_Range>(__range)})) - -> decltype( common_view{std::forward<_Range>(__range)}) - { return common_view{std::forward<_Range>(__range)}; } - }; -} // namespace __common - -inline namespace __cpo { - inline constexpr auto common = __common::__fn{}; -} // namespace __cpo -} // namespace views -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_COMMON_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h deleted file mode 100644 index 8b7f227925c..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/copyable_box.h +++ /dev/null @@ -1,178 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___RANGES_COPYABLE_BOX_H -#define _LIBCPP___RANGES_COPYABLE_BOX_H - -#include <__config> -#include <__memory/addressof.h> -#include <__memory/construct_at.h> -#include <__utility/move.h> -#include <concepts> -#include <optional> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -// __copyable_box allows turning a type that is copy-constructible (but maybe not copy-assignable) into -// a type that is both copy-constructible and copy-assignable. It does that by introducing an empty state -// and basically doing destroy-then-copy-construct in the assignment operator. The empty state is necessary -// to handle the case where the copy construction fails after destroying the object. -// -// In some cases, we can completely avoid the use of an empty state; we provide a specialization of -// __copyable_box that does this, see below for the details. - -template<class _Tp> -concept __copy_constructible_object = copy_constructible<_Tp> && is_object_v<_Tp>; - -namespace ranges { - // Primary template - uses std::optional and introduces an empty state in case assignment fails. - template<__copy_constructible_object _Tp> - class __copyable_box { - _LIBCPP_NO_UNIQUE_ADDRESS optional<_Tp> __val_; - - public: - template<class ..._Args> - requires is_constructible_v<_Tp, _Args...> - _LIBCPP_HIDE_FROM_ABI - constexpr explicit __copyable_box(in_place_t, _Args&& ...__args) - noexcept(is_nothrow_constructible_v<_Tp, _Args...>) - : __val_(in_place, std::forward<_Args>(__args)...) - { } - - _LIBCPP_HIDE_FROM_ABI - constexpr __copyable_box() noexcept(is_nothrow_default_constructible_v<_Tp>) - requires default_initializable<_Tp> - : __val_(in_place) - { } - - _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default; - _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr __copyable_box& operator=(__copyable_box const& __other) - noexcept(is_nothrow_copy_constructible_v<_Tp>) - { - if (this != std::addressof(__other)) { - if (__other.__has_value()) __val_.emplace(*__other); - else __val_.reset(); - } - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr __copyable_box& operator=(__copyable_box&& __other) - noexcept(is_nothrow_move_constructible_v<_Tp>) - { - if (this != std::addressof(__other)) { - if (__other.__has_value()) __val_.emplace(std::move(*__other)); - else __val_.reset(); - } - return *this; - } - - _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return *__val_; } - _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return *__val_; } - - _LIBCPP_HIDE_FROM_ABI constexpr const _Tp *operator->() const noexcept { return __val_.operator->(); } - _LIBCPP_HIDE_FROM_ABI constexpr _Tp *operator->() noexcept { return __val_.operator->(); } - - _LIBCPP_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return __val_.has_value(); } - }; - - // This partial specialization implements an optimization for when we know we don't need to store - // an empty state to represent failure to perform an assignment. For copy-assignment, this happens: - // - // 1. If the type is copyable (which includes copy-assignment), we can use the type's own assignment operator - // directly and avoid using std::optional. - // 2. If the type is not copyable, but it is nothrow-copy-constructible, then we can implement assignment as - // destroy-and-then-construct and we know it will never fail, so we don't need an empty state. - // - // The exact same reasoning can be applied for move-assignment, with copyable replaced by movable and - // nothrow-copy-constructible replaced by nothrow-move-constructible. This specialization is enabled - // whenever we can apply any of these optimizations for both the copy assignment and the move assignment - // operator. - template<class _Tp> - concept __doesnt_need_empty_state_for_copy = copyable<_Tp> || is_nothrow_copy_constructible_v<_Tp>; - - template<class _Tp> - concept __doesnt_need_empty_state_for_move = movable<_Tp> || is_nothrow_move_constructible_v<_Tp>; - - template<__copy_constructible_object _Tp> - requires __doesnt_need_empty_state_for_copy<_Tp> && __doesnt_need_empty_state_for_move<_Tp> - class __copyable_box<_Tp> { - _LIBCPP_NO_UNIQUE_ADDRESS _Tp __val_; - - public: - template<class ..._Args> - requires is_constructible_v<_Tp, _Args...> - _LIBCPP_HIDE_FROM_ABI - constexpr explicit __copyable_box(in_place_t, _Args&& ...__args) - noexcept(is_nothrow_constructible_v<_Tp, _Args...>) - : __val_(std::forward<_Args>(__args)...) - { } - - _LIBCPP_HIDE_FROM_ABI - constexpr __copyable_box() noexcept(is_nothrow_default_constructible_v<_Tp>) - requires default_initializable<_Tp> - : __val_() - { } - - _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box const&) = default; - _LIBCPP_HIDE_FROM_ABI __copyable_box(__copyable_box&&) = default; - - // Implementation of assignment operators in case we perform optimization (1) - _LIBCPP_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box const&) requires copyable<_Tp> = default; - _LIBCPP_HIDE_FROM_ABI __copyable_box& operator=(__copyable_box&&) requires movable<_Tp> = default; - - // Implementation of assignment operators in case we perform optimization (2) - _LIBCPP_HIDE_FROM_ABI - constexpr __copyable_box& operator=(__copyable_box const& __other) noexcept { - static_assert(is_nothrow_copy_constructible_v<_Tp>); - if (this != std::addressof(__other)) { - std::destroy_at(std::addressof(__val_)); - std::construct_at(std::addressof(__val_), __other.__val_); - } - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __copyable_box& operator=(__copyable_box&& __other) noexcept { - static_assert(is_nothrow_move_constructible_v<_Tp>); - if (this != std::addressof(__other)) { - std::destroy_at(std::addressof(__val_)); - std::construct_at(std::addressof(__val_), std::move(__other.__val_)); - } - return *this; - } - - _LIBCPP_HIDE_FROM_ABI constexpr _Tp const& operator*() const noexcept { return __val_; } - _LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() noexcept { return __val_; } - - _LIBCPP_HIDE_FROM_ABI constexpr const _Tp *operator->() const noexcept { return std::addressof(__val_); } - _LIBCPP_HIDE_FROM_ABI constexpr _Tp *operator->() noexcept { return std::addressof(__val_); } - - _LIBCPP_HIDE_FROM_ABI constexpr bool __has_value() const noexcept { return true; } - }; -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_COPYABLE_BOX_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h deleted file mode 100644 index 400284c48e6..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/counted.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_COUNTED_H -#define _LIBCPP___RANGES_COUNTED_H - -#include <__concepts/convertible_to.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/counted_iterator.h> -#include <__iterator/default_sentinel.h> -#include <__iterator/incrementable_traits.h> -#include <__iterator/iterator_traits.h> -#include <__memory/pointer_traits.h> -#include <__ranges/subrange.h> -#include <__utility/forward.h> -#include <__utility/move.h> -#include <span> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges::views { - -namespace __counted { - - struct __fn { - template<contiguous_iterator _It> - _LIBCPP_HIDE_FROM_ABI - static constexpr auto __go(_It __it, iter_difference_t<_It> __count) - noexcept(noexcept(span(std::to_address(__it), static_cast<size_t>(__count)))) - // Deliberately omit return-type SFINAE, because to_address is not SFINAE-friendly - { return span(std::to_address(__it), static_cast<size_t>(__count)); } - - template<random_access_iterator _It> - _LIBCPP_HIDE_FROM_ABI - static constexpr auto __go(_It __it, iter_difference_t<_It> __count) - noexcept(noexcept(subrange(__it, __it + __count))) - -> decltype( subrange(__it, __it + __count)) - { return subrange(__it, __it + __count); } - - template<class _It> - _LIBCPP_HIDE_FROM_ABI - static constexpr auto __go(_It __it, iter_difference_t<_It> __count) - noexcept(noexcept(subrange(counted_iterator(std::move(__it), __count), default_sentinel))) - -> decltype( subrange(counted_iterator(std::move(__it), __count), default_sentinel)) - { return subrange(counted_iterator(std::move(__it), __count), default_sentinel); } - - template<class _It, convertible_to<iter_difference_t<_It>> _Diff> - requires input_or_output_iterator<decay_t<_It>> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_It&& __it, _Diff&& __count) const - noexcept(noexcept(__go(std::forward<_It>(__it), std::forward<_Diff>(__count)))) - -> decltype( __go(std::forward<_It>(__it), std::forward<_Diff>(__count))) - { return __go(std::forward<_It>(__it), std::forward<_Diff>(__count)); } - }; - -} // namespace __counted - -inline namespace __cpo { - inline constexpr auto counted = __counted::__fn{}; -} // namespace __cpo - -} // namespace ranges::views - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_COUNTED_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h deleted file mode 100644 index 0e5b68b11d0..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/drop_view.h +++ /dev/null @@ -1,127 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_DROP_VIEW_H -#define _LIBCPP___RANGES_DROP_VIEW_H - -#include <__config> -#include <__debug> -#include <__iterator/concepts.h> -#include <__iterator/iterator_traits.h> -#include <__iterator/next.h> -#include <__ranges/access.h> -#include <__ranges/all.h> -#include <__ranges/concepts.h> -#include <__ranges/enable_borrowed_range.h> -#include <__ranges/non_propagating_cache.h> -#include <__ranges/size.h> -#include <__ranges/view_interface.h> -#include <__utility/move.h> -#include <concepts> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - template<view _View> - class drop_view - : public view_interface<drop_view<_View>> - { - // We cache begin() whenever ranges::next is not guaranteed O(1) to provide an - // amortized O(1) begin() method. If this is an input_range, then we cannot cache - // begin because begin is not equality preserving. - // Note: drop_view<input-range>::begin() is still trivially amortized O(1) because - // one can't call begin() on it more than once. - static constexpr bool _UseCache = forward_range<_View> && !(random_access_range<_View> && sized_range<_View>); - using _Cache = _If<_UseCache, __non_propagating_cache<iterator_t<_View>>, __empty_cache>; - _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache(); - range_difference_t<_View> __count_ = 0; - _View __base_ = _View(); - -public: - drop_view() requires default_initializable<_View> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr drop_view(_View __base, range_difference_t<_View> __count) - : __count_(__count) - , __base_(std::move(__base)) - { - _LIBCPP_ASSERT(__count_ >= 0, "count must be greater than or equal to zero."); - } - - _LIBCPP_HIDE_FROM_ABI constexpr _View base() const& requires copy_constructible<_View> { return __base_; } - _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto begin() - requires (!(__simple_view<_View> && - random_access_range<const _View> && sized_range<const _View>)) - { - if constexpr (_UseCache) - if (__cached_begin_.__has_value()) - return *__cached_begin_; - - auto __tmp = ranges::next(ranges::begin(__base_), __count_, ranges::end(__base_)); - if constexpr (_UseCache) - __cached_begin_.__emplace(__tmp); - return __tmp; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto begin() const - requires random_access_range<const _View> && sized_range<const _View> - { - return ranges::next(ranges::begin(__base_), __count_, ranges::end(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto end() - requires (!__simple_view<_View>) - { return ranges::end(__base_); } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto end() const - requires range<const _View> - { return ranges::end(__base_); } - - _LIBCPP_HIDE_FROM_ABI - static constexpr auto __size(auto& __self) { - const auto __s = ranges::size(__self.__base_); - const auto __c = static_cast<decltype(__s)>(__self.__count_); - return __s < __c ? 0 : __s - __c; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() - requires sized_range<_View> - { return __size(*this); } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() const - requires sized_range<const _View> - { return __size(*this); } - }; - - template<class _Range> - drop_view(_Range&&, range_difference_t<_Range>) -> drop_view<views::all_t<_Range>>; - - template<class _Tp> - inline constexpr bool enable_borrowed_range<drop_view<_Tp>> = enable_borrowed_range<_Tp>; -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_DROP_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h deleted file mode 100644 index c83cdd7482e..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/empty.h +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_EMPTY_H -#define _LIBCPP___RANGES_EMPTY_H - -#include <__concepts/class_or_enum.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__ranges/access.h> -#include <__ranges/size.h> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -// [range.prim.empty] - -namespace ranges { -namespace __empty { - template <class _Tp> - concept __member_empty = - __workaround_52970<_Tp> && - requires(_Tp&& __t) { - bool(__t.empty()); - }; - - template<class _Tp> - concept __can_invoke_size = - !__member_empty<_Tp> && - requires(_Tp&& __t) { ranges::size(__t); }; - - template <class _Tp> - concept __can_compare_begin_end = - !__member_empty<_Tp> && - !__can_invoke_size<_Tp> && - requires(_Tp&& __t) { - bool(ranges::begin(__t) == ranges::end(__t)); - { ranges::begin(__t) } -> forward_iterator; - }; - - struct __fn { - template <__member_empty _Tp> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const - noexcept(noexcept(bool(__t.empty()))) { - return bool(__t.empty()); - } - - template <__can_invoke_size _Tp> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const - noexcept(noexcept(ranges::size(__t))) { - return ranges::size(__t) == 0; - } - - template<__can_compare_begin_end _Tp> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const - noexcept(noexcept(bool(ranges::begin(__t) == ranges::end(__t)))) { - return ranges::begin(__t) == ranges::end(__t); - } - }; -} // namespace __empty - -inline namespace __cpo { - inline constexpr auto empty = __empty::__fn{}; -} // namespace __cpo -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_EMPTY_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h deleted file mode 100644 index 232b0b8fadf..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/empty_view.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_EMPTY_VIEW_H -#define _LIBCPP___RANGES_EMPTY_VIEW_H - -#include <__config> -#include <__ranges/enable_borrowed_range.h> -#include <__ranges/view_interface.h> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - template<class _Tp> - requires is_object_v<_Tp> - class empty_view : public view_interface<empty_view<_Tp>> { - public: - _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* begin() noexcept { return nullptr; } - _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* end() noexcept { return nullptr; } - _LIBCPP_HIDE_FROM_ABI static constexpr _Tp* data() noexcept { return nullptr; } - _LIBCPP_HIDE_FROM_ABI static constexpr size_t size() noexcept { return 0; } - _LIBCPP_HIDE_FROM_ABI static constexpr bool empty() noexcept { return true; } - }; - - template<class _Tp> - inline constexpr bool enable_borrowed_range<empty_view<_Tp>> = true; -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_EMPTY_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h deleted file mode 100644 index 2fbc6077895..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/iota_view.h +++ /dev/null @@ -1,408 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_IOTA_VIEW_H -#define _LIBCPP___RANGES_IOTA_VIEW_H - -#include <__compare/three_way_comparable.h> -#include <__concepts/arithmetic.h> -#include <__concepts/constructible.h> -#include <__concepts/convertible_to.h> -#include <__concepts/copyable.h> -#include <__concepts/equality_comparable.h> -#include <__concepts/invocable.h> -#include <__concepts/same_as.h> -#include <__concepts/semiregular.h> -#include <__concepts/totally_ordered.h> -#include <__config> -#include <__debug> -#include <__functional/ranges_operations.h> -#include <__iterator/concepts.h> -#include <__iterator/incrementable_traits.h> -#include <__iterator/iterator_traits.h> -#include <__iterator/unreachable_sentinel.h> -#include <__ranges/copyable_box.h> -#include <__ranges/enable_borrowed_range.h> -#include <__ranges/view_interface.h> -#include <__utility/forward.h> -#include <__utility/move.h> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - template<class _Int> - struct __get_wider_signed { - static auto __call() { - if constexpr (sizeof(_Int) < sizeof(short)) return type_identity<short>{}; - else if constexpr (sizeof(_Int) < sizeof(int)) return type_identity<int>{}; - else if constexpr (sizeof(_Int) < sizeof(long)) return type_identity<long>{}; - else return type_identity<long long>{}; - - static_assert(sizeof(_Int) <= sizeof(long long), - "Found integer-like type that is bigger than largest integer like type."); - } - - using type = typename decltype(__call())::type; - }; - - template<class _Start> - using _IotaDiffT = typename _If< - (!integral<_Start> || sizeof(iter_difference_t<_Start>) > sizeof(_Start)), - type_identity<iter_difference_t<_Start>>, - __get_wider_signed<_Start> - >::type; - - template<class _Iter> - concept __decrementable = incrementable<_Iter> && requires(_Iter __i) { - { --__i } -> same_as<_Iter&>; - { __i-- } -> same_as<_Iter>; - }; - - template<class _Iter> - concept __advanceable = - __decrementable<_Iter> && totally_ordered<_Iter> && - requires(_Iter __i, const _Iter __j, const _IotaDiffT<_Iter> __n) { - { __i += __n } -> same_as<_Iter&>; - { __i -= __n } -> same_as<_Iter&>; - _Iter(__j + __n); - _Iter(__n + __j); - _Iter(__j - __n); - { __j - __j } -> convertible_to<_IotaDiffT<_Iter>>; - }; - - template<class> - struct __iota_iterator_category {}; - - template<incrementable _Tp> - struct __iota_iterator_category<_Tp> { - using iterator_category = input_iterator_tag; - }; - - template<weakly_incrementable _Start, semiregular _Bound = unreachable_sentinel_t> - requires __weakly_equality_comparable_with<_Start, _Bound> && copyable<_Start> - class iota_view : public view_interface<iota_view<_Start, _Bound>> { - struct __iterator : public __iota_iterator_category<_Start> { - friend class iota_view; - - using iterator_concept = - _If<__advanceable<_Start>, random_access_iterator_tag, - _If<__decrementable<_Start>, bidirectional_iterator_tag, - _If<incrementable<_Start>, forward_iterator_tag, - /*Else*/ input_iterator_tag>>>; - - using value_type = _Start; - using difference_type = _IotaDiffT<_Start>; - - _Start __value_ = _Start(); - - _LIBCPP_HIDE_FROM_ABI - __iterator() requires default_initializable<_Start> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit __iterator(_Start __value) : __value_(std::move(__value)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr _Start operator*() const noexcept(is_nothrow_copy_constructible_v<_Start>) { - return __value_; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator& operator++() { - ++__value_; - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr void operator++(int) { ++*this; } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator operator++(int) requires incrementable<_Start> { - auto __tmp = *this; - ++*this; - return __tmp; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator& operator--() requires __decrementable<_Start> { - --__value_; - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator operator--(int) requires __decrementable<_Start> { - auto __tmp = *this; - --*this; - return __tmp; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator& operator+=(difference_type __n) - requires __advanceable<_Start> - { - if constexpr (__integer_like<_Start> && !__signed_integer_like<_Start>) { - if (__n >= difference_type(0)) { - __value_ += static_cast<_Start>(__n); - } else { - __value_ -= static_cast<_Start>(-__n); - } - } else { - __value_ += __n; - } - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator& operator-=(difference_type __n) - requires __advanceable<_Start> - { - if constexpr (__integer_like<_Start> && !__signed_integer_like<_Start>) { - if (__n >= difference_type(0)) { - __value_ -= static_cast<_Start>(__n); - } else { - __value_ += static_cast<_Start>(-__n); - } - } else { - __value_ -= __n; - } - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr _Start operator[](difference_type __n) const - requires __advanceable<_Start> - { - return _Start(__value_ + __n); - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) - requires equality_comparable<_Start> - { - return __x.__value_ == __y.__value_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator<(const __iterator& __x, const __iterator& __y) - requires totally_ordered<_Start> - { - return __x.__value_ < __y.__value_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator>(const __iterator& __x, const __iterator& __y) - requires totally_ordered<_Start> - { - return __y < __x; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y) - requires totally_ordered<_Start> - { - return !(__y < __x); - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y) - requires totally_ordered<_Start> - { - return !(__x < __y); - } - - friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y) - requires totally_ordered<_Start> && three_way_comparable<_Start> - { - return __x.__value_ <=> __y.__value_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr __iterator operator+(__iterator __i, difference_type __n) - requires __advanceable<_Start> - { - __i += __n; - return __i; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr __iterator operator+(difference_type __n, __iterator __i) - requires __advanceable<_Start> - { - return __i + __n; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr __iterator operator-(__iterator __i, difference_type __n) - requires __advanceable<_Start> - { - __i -= __n; - return __i; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y) - requires __advanceable<_Start> - { - if constexpr (__integer_like<_Start>) { - if constexpr (__signed_integer_like<_Start>) { - return difference_type(difference_type(__x.__value_) - difference_type(__y.__value_)); - } - if (__y.__value_ > __x.__value_) { - return difference_type(-difference_type(__y.__value_ - __x.__value_)); - } - return difference_type(__x.__value_ - __y.__value_); - } - return __x.__value_ - __y.__value_; - } - }; - - struct __sentinel { - friend class iota_view; - - private: - _Bound __bound_ = _Bound(); - - public: - _LIBCPP_HIDE_FROM_ABI - __sentinel() = default; - constexpr explicit __sentinel(_Bound __bound) : __bound_(std::move(__bound)) {} - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator==(const __iterator& __x, const __sentinel& __y) { - return __x.__value_ == __y.__bound_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr iter_difference_t<_Start> operator-(const __iterator& __x, const __sentinel& __y) - requires sized_sentinel_for<_Bound, _Start> - { - return __x.__value_ - __y.__bound_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr iter_difference_t<_Start> operator-(const __sentinel& __x, const __iterator& __y) - requires sized_sentinel_for<_Bound, _Start> - { - return -(__y - __x); - } - }; - - _Start __value_ = _Start(); - _Bound __bound_ = _Bound(); - - public: - _LIBCPP_HIDE_FROM_ABI - iota_view() requires default_initializable<_Start> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit iota_view(_Start __value) : __value_(std::move(__value)) { } - - _LIBCPP_HIDE_FROM_ABI - constexpr iota_view(type_identity_t<_Start> __value, type_identity_t<_Bound> __bound) - : __value_(std::move(__value)), __bound_(std::move(__bound)) { - // Validate the precondition if possible. - if constexpr (totally_ordered_with<_Start, _Bound>) { - _LIBCPP_ASSERT(ranges::less_equal()(__value_, __bound_), - "Precondition violated: value is greater than bound."); - } - } - - _LIBCPP_HIDE_FROM_ABI - constexpr iota_view(__iterator __first, __iterator __last) - requires same_as<_Start, _Bound> - : iota_view(std::move(__first.__value_), std::move(__last.__value_)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr iota_view(__iterator __first, _Bound __last) - requires same_as<_Bound, unreachable_sentinel_t> - : iota_view(std::move(__first.__value_), std::move(__last)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr iota_view(__iterator __first, __sentinel __last) - requires (!same_as<_Start, _Bound> && !same_as<_Start, unreachable_sentinel_t>) - : iota_view(std::move(__first.__value_), std::move(__last.__bound_)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator begin() const { return __iterator{__value_}; } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto end() const { - if constexpr (same_as<_Bound, unreachable_sentinel_t>) - return unreachable_sentinel; - else - return __sentinel{__bound_}; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator end() const requires same_as<_Start, _Bound> { - return __iterator{__bound_}; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() const - requires (same_as<_Start, _Bound> && __advanceable<_Start>) || - (integral<_Start> && integral<_Bound>) || - sized_sentinel_for<_Bound, _Start> - { - if constexpr (__integer_like<_Start> && __integer_like<_Bound>) { - if (__value_ < 0) { - if (__bound_ < 0) { - return std::__to_unsigned_like(-__value_) - std::__to_unsigned_like(-__bound_); - } - return std::__to_unsigned_like(__bound_) + std::__to_unsigned_like(-__value_); - } - return std::__to_unsigned_like(__bound_) - std::__to_unsigned_like(__value_); - } - return std::__to_unsigned_like(__bound_ - __value_); - } - }; - - template<class _Start, class _Bound> - requires (!__integer_like<_Start> || !__integer_like<_Bound> || - (__signed_integer_like<_Start> == __signed_integer_like<_Bound>)) - iota_view(_Start, _Bound) -> iota_view<_Start, _Bound>; - - template<class _Start, class _Bound> - inline constexpr bool enable_borrowed_range<iota_view<_Start, _Bound>> = true; - -namespace views { -namespace __iota { - struct __fn { - template<class _Start> - _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Start&& __start) const - noexcept(noexcept(ranges::iota_view(std::forward<_Start>(__start)))) - -> decltype( ranges::iota_view(std::forward<_Start>(__start))) - { return ranges::iota_view(std::forward<_Start>(__start)); } - - template<class _Start, class _Bound> - _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Start&& __start, _Bound&& __bound) const - noexcept(noexcept(ranges::iota_view(std::forward<_Start>(__start), std::forward<_Bound>(__bound)))) - -> decltype( ranges::iota_view(std::forward<_Start>(__start), std::forward<_Bound>(__bound))) - { return ranges::iota_view(std::forward<_Start>(__start), std::forward<_Bound>(__bound)); } - }; -} // namespace __iota - -inline namespace __cpo { - inline constexpr auto iota = __iota::__fn{}; -} // namespace __cpo -} // namespace views -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_IOTA_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h deleted file mode 100644 index 18180984d19..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/join_view.h +++ /dev/null @@ -1,350 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_JOIN_VIEW_H -#define _LIBCPP___RANGES_JOIN_VIEW_H - -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/iterator_traits.h> -#include <__ranges/access.h> -#include <__ranges/all.h> -#include <__ranges/concepts.h> -#include <__ranges/non_propagating_cache.h> -#include <__ranges/ref_view.h> -#include <__ranges/subrange.h> -#include <__ranges/view_interface.h> -#include <__utility/declval.h> -#include <__utility/forward.h> -#include <optional> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - template<class> - struct __join_view_iterator_category {}; - - template<class _View> - requires is_reference_v<range_reference_t<_View>> && - forward_range<_View> && - forward_range<range_reference_t<_View>> - struct __join_view_iterator_category<_View> { - using _OuterC = typename iterator_traits<iterator_t<_View>>::iterator_category; - using _InnerC = typename iterator_traits<iterator_t<range_reference_t<_View>>>::iterator_category; - - using iterator_category = _If< - derived_from<_OuterC, bidirectional_iterator_tag> && derived_from<_InnerC, bidirectional_iterator_tag>, - bidirectional_iterator_tag, - _If< - derived_from<_OuterC, forward_iterator_tag> && derived_from<_InnerC, forward_iterator_tag>, - forward_iterator_tag, - input_iterator_tag - > - >; - }; - - template<input_range _View> - requires view<_View> && input_range<range_reference_t<_View>> - class join_view - : public view_interface<join_view<_View>> { - private: - using _InnerRange = range_reference_t<_View>; - - template<bool> struct __iterator; - template<bool> struct __sentinel; - - static constexpr bool _UseCache = !is_reference_v<_InnerRange>; - using _Cache = _If<_UseCache, __non_propagating_cache<remove_cvref_t<_InnerRange>>, __empty_cache>; - _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cache_; - _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); - - public: - _LIBCPP_HIDE_FROM_ABI - join_view() requires default_initializable<_View> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit join_view(_View __base) - : __base_(std::move(__base)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr _View base() const& requires copy_constructible<_View> { return __base_; } - - _LIBCPP_HIDE_FROM_ABI - constexpr _View base() && { return std::move(__base_); } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto begin() { - constexpr bool __use_const = __simple_view<_View> && - is_reference_v<range_reference_t<_View>>; - return __iterator<__use_const>{*this, ranges::begin(__base_)}; - } - - template<class _V2 = _View> - _LIBCPP_HIDE_FROM_ABI - constexpr auto begin() const - requires input_range<const _V2> && - is_reference_v<range_reference_t<const _V2>> - { - return __iterator<true>{*this, ranges::begin(__base_)}; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto end() { - if constexpr (forward_range<_View> && - is_reference_v<_InnerRange> && - forward_range<_InnerRange> && - common_range<_View> && - common_range<_InnerRange>) - return __iterator<__simple_view<_View>>{*this, ranges::end(__base_)}; - else - return __sentinel<__simple_view<_View>>{*this}; - } - - template<class _V2 = _View> - _LIBCPP_HIDE_FROM_ABI - constexpr auto end() const - requires input_range<const _V2> && - is_reference_v<range_reference_t<const _V2>> - { - using _ConstInnerRange = range_reference_t<const _View>; - if constexpr (forward_range<const _View> && - is_reference_v<_ConstInnerRange> && - forward_range<_ConstInnerRange> && - common_range<const _View> && - common_range<_ConstInnerRange>) { - return __iterator<true>{*this, ranges::end(__base_)}; - } else { - return __sentinel<true>{*this}; - } - } - }; - - template<input_range _View> - requires view<_View> && input_range<range_reference_t<_View>> - template<bool _Const> struct join_view<_View>::__sentinel { - template<bool> friend struct __sentinel; - - private: - using _Parent = __maybe_const<_Const, join_view>; - using _Base = __maybe_const<_Const, _View>; - sentinel_t<_Base> __end_ = sentinel_t<_Base>(); - - public: - _LIBCPP_HIDE_FROM_ABI - __sentinel() = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit __sentinel(_Parent& __parent) - : __end_(ranges::end(__parent.__base_)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr __sentinel(__sentinel<!_Const> __s) - requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>> - : __end_(std::move(__s.__end_)) {} - - template<bool _OtherConst> - requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) { - return __x.__outer_ == __y.__end_; - } - }; - - template<input_range _View> - requires view<_View> && input_range<range_reference_t<_View>> - template<bool _Const> struct join_view<_View>::__iterator - : public __join_view_iterator_category<__maybe_const<_Const, _View>> { - - template<bool> friend struct __iterator; - - private: - using _Parent = __maybe_const<_Const, join_view>; - using _Base = __maybe_const<_Const, _View>; - using _Outer = iterator_t<_Base>; - using _Inner = iterator_t<range_reference_t<_Base>>; - - static constexpr bool __ref_is_glvalue = is_reference_v<range_reference_t<_Base>>; - - public: - _Outer __outer_ = _Outer(); - - private: - optional<_Inner> __inner_; - _Parent *__parent_ = nullptr; - - _LIBCPP_HIDE_FROM_ABI - constexpr void __satisfy() { - for (; __outer_ != ranges::end(__parent_->__base_); ++__outer_) { - auto&& __inner = [&]() -> auto&& { - if constexpr (__ref_is_glvalue) - return *__outer_; - else - return __parent_->__cache_.__emplace_from([&]() -> decltype(auto) { return *__outer_; }); - }(); - __inner_ = ranges::begin(__inner); - if (*__inner_ != ranges::end(__inner)) - return; - } - - if constexpr (__ref_is_glvalue) - __inner_.reset(); - } - - public: - using iterator_concept = _If< - __ref_is_glvalue && bidirectional_range<_Base> && bidirectional_range<range_reference_t<_Base>>, - bidirectional_iterator_tag, - _If< - __ref_is_glvalue && forward_range<_Base> && forward_range<range_reference_t<_Base>>, - forward_iterator_tag, - input_iterator_tag - > - >; - - using value_type = range_value_t<range_reference_t<_Base>>; - - using difference_type = common_type_t< - range_difference_t<_Base>, range_difference_t<range_reference_t<_Base>>>; - - _LIBCPP_HIDE_FROM_ABI - __iterator() requires default_initializable<_Outer> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator(_Parent& __parent, _Outer __outer) - : __outer_(std::move(__outer)) - , __parent_(std::addressof(__parent)) { - __satisfy(); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator(__iterator<!_Const> __i) - requires _Const && - convertible_to<iterator_t<_View>, _Outer> && - convertible_to<iterator_t<_InnerRange>, _Inner> - : __outer_(std::move(__i.__outer_)) - , __inner_(std::move(__i.__inner_)) - , __parent_(__i.__parent_) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr decltype(auto) operator*() const { - return **__inner_; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr _Inner operator->() const - requires __has_arrow<_Inner> && copyable<_Inner> - { - return *__inner_; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator& operator++() { - auto&& __inner = [&]() -> auto&& { - if constexpr (__ref_is_glvalue) - return *__outer_; - else - return *__parent_->__cache_; - }(); - if (++*__inner_ == ranges::end(__inner)) { - ++__outer_; - __satisfy(); - } - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr void operator++(int) { - ++*this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator operator++(int) - requires __ref_is_glvalue && - forward_range<_Base> && - forward_range<range_reference_t<_Base>> - { - auto __tmp = *this; - ++*this; - return __tmp; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator& operator--() - requires __ref_is_glvalue && - bidirectional_range<_Base> && - bidirectional_range<range_reference_t<_Base>> && - common_range<range_reference_t<_Base>> - { - if (__outer_ == ranges::end(__parent_->__base_)) - __inner_ = ranges::end(*--__outer_); - - // Skip empty inner ranges when going backwards. - while (*__inner_ == ranges::begin(*__outer_)) { - __inner_ = ranges::end(*--__outer_); - } - - --*__inner_; - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator operator--(int) - requires __ref_is_glvalue && - bidirectional_range<_Base> && - bidirectional_range<range_reference_t<_Base>> && - common_range<range_reference_t<_Base>> - { - auto __tmp = *this; - --*this; - return __tmp; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) - requires __ref_is_glvalue && - equality_comparable<iterator_t<_Base>> && - equality_comparable<iterator_t<range_reference_t<_Base>>> - { - return __x.__outer_ == __y.__outer_ && __x.__inner_ == __y.__inner_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr decltype(auto) iter_move(const __iterator& __i) - noexcept(noexcept(ranges::iter_move(*__i.__inner_))) - { - return ranges::iter_move(*__i.__inner_); - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr void iter_swap(const __iterator& __x, const __iterator& __y) - noexcept(noexcept(ranges::iter_swap(*__x.__inner_, *__y.__inner_))) - requires indirectly_swappable<_Inner> - { - return ranges::iter_swap(*__x.__inner_, *__y.__inner_); - } - }; - - template<class _Range> - explicit join_view(_Range&&) -> join_view<views::all_t<_Range>>; - -} // namespace ranges - -#undef _CONSTEXPR_TERNARY - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_JOIN_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/non_propagating_cache.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/non_propagating_cache.h deleted file mode 100644 index 30fcd9f11ed..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/non_propagating_cache.h +++ /dev/null @@ -1,114 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H -#define _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H - -#include <__config> -#include <__iterator/concepts.h> // indirectly_readable -#include <__iterator/iterator_traits.h> // iter_reference_t -#include <__memory/addressof.h> -#include <__utility/forward.h> -#include <concepts> // constructible_from -#include <optional> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - // __non_propagating_cache is a helper type that allows storing an optional value in it, - // but which does not copy the source's value when it is copy constructed/assigned to, - // and which resets the source's value when it is moved-from. - // - // This type is used as an implementation detail of some views that need to cache the - // result of `begin()` in order to provide an amortized O(1) begin() method. Typically, - // we don't want to propagate the value of the cache upon copy because the cached iterator - // may refer to internal details of the source view. - template<class _Tp> - requires is_object_v<_Tp> - class _LIBCPP_TEMPLATE_VIS __non_propagating_cache { - struct __from_tag { }; - struct __forward_tag { }; - - // This helper class is needed to perform copy and move elision when - // constructing the contained type from an iterator. - struct __wrapper { - template<class ..._Args> - constexpr explicit __wrapper(__forward_tag, _Args&& ...__args) : __t_(std::forward<_Args>(__args)...) { } - template<class _Fn> - constexpr explicit __wrapper(__from_tag, _Fn const& __f) : __t_(__f()) { } - _Tp __t_; - }; - - optional<__wrapper> __value_ = nullopt; - - public: - _LIBCPP_HIDE_FROM_ABI __non_propagating_cache() = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr __non_propagating_cache(__non_propagating_cache const&) noexcept - : __value_(nullopt) - { } - - _LIBCPP_HIDE_FROM_ABI - constexpr __non_propagating_cache(__non_propagating_cache&& __other) noexcept - : __value_(nullopt) - { - __other.__value_.reset(); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __non_propagating_cache& operator=(__non_propagating_cache const& __other) noexcept { - if (this != std::addressof(__other)) { - __value_.reset(); - } - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __non_propagating_cache& operator=(__non_propagating_cache&& __other) noexcept { - __value_.reset(); - __other.__value_.reset(); - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr _Tp& operator*() { return __value_->__t_; } - _LIBCPP_HIDE_FROM_ABI - constexpr _Tp const& operator*() const { return __value_->__t_; } - - _LIBCPP_HIDE_FROM_ABI - constexpr bool __has_value() const { return __value_.has_value(); } - - template<class _Fn> - _LIBCPP_HIDE_FROM_ABI - constexpr _Tp& __emplace_from(_Fn const& __f) { - return __value_.emplace(__from_tag{}, __f).__t_; - } - - template<class ..._Args> - _LIBCPP_HIDE_FROM_ABI - constexpr _Tp& __emplace(_Args&& ...__args) { - return __value_.emplace(__forward_tag{}, std::forward<_Args>(__args)...).__t_; - } - }; - - struct __empty_cache { }; -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_NON_PROPAGATING_CACHE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h deleted file mode 100644 index 322152d7caa..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/owning_view.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_OWNING_VIEW_H -#define _LIBCPP___RANGES_OWNING_VIEW_H - -#include <__concepts/constructible.h> -#include <__concepts/movable.h> -#include <__config> -#include <__ranges/access.h> -#include <__ranges/concepts.h> -#include <__ranges/data.h> -#include <__ranges/empty.h> -#include <__ranges/enable_borrowed_range.h> -#include <__ranges/size.h> -#include <__ranges/view_interface.h> -#include <__utility/move.h> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - template<range _Rp> - requires movable<_Rp> && (!__is_std_initializer_list<remove_cvref_t<_Rp>>) - class owning_view : public view_interface<owning_view<_Rp>> { - _Rp __r_ = _Rp(); - -public: - owning_view() requires default_initializable<_Rp> = default; - _LIBCPP_HIDE_FROM_ABI constexpr owning_view(_Rp&& __r) : __r_(std::move(__r)) {} - - owning_view(owning_view&&) = default; - owning_view& operator=(owning_view&&) = default; - - _LIBCPP_HIDE_FROM_ABI constexpr _Rp& base() & noexcept { return __r_; } - _LIBCPP_HIDE_FROM_ABI constexpr const _Rp& base() const& noexcept { return __r_; } - _LIBCPP_HIDE_FROM_ABI constexpr _Rp&& base() && noexcept { return std::move(__r_); } - _LIBCPP_HIDE_FROM_ABI constexpr const _Rp&& base() const&& noexcept { return std::move(__r_); } - - _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Rp> begin() { return ranges::begin(__r_); } - _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Rp> end() { return ranges::end(__r_); } - _LIBCPP_HIDE_FROM_ABI constexpr auto begin() const requires range<const _Rp> { return ranges::begin(__r_); } - _LIBCPP_HIDE_FROM_ABI constexpr auto end() const requires range<const _Rp> { return ranges::end(__r_); } - - _LIBCPP_HIDE_FROM_ABI constexpr bool empty() requires requires { ranges::empty(__r_); } - { return ranges::empty(__r_); } - _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const requires requires { ranges::empty(__r_); } - { return ranges::empty(__r_); } - - _LIBCPP_HIDE_FROM_ABI constexpr auto size() requires sized_range<_Rp> - { return ranges::size(__r_); } - _LIBCPP_HIDE_FROM_ABI constexpr auto size() const requires sized_range<const _Rp> - { return ranges::size(__r_); } - - _LIBCPP_HIDE_FROM_ABI constexpr auto data() requires contiguous_range<_Rp> - { return ranges::data(__r_); } - _LIBCPP_HIDE_FROM_ABI constexpr auto data() const requires contiguous_range<const _Rp> - { return ranges::data(__r_); } - }; - - template<class _Tp> - inline constexpr bool enable_borrowed_range<owning_view<_Tp>> = enable_borrowed_range<_Tp>; - -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_OWNING_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h deleted file mode 100644 index 9b456b18f04..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/range_adaptor.h +++ /dev/null @@ -1,73 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___RANGES_RANGE_ADAPTOR_H -#define _LIBCPP___RANGES_RANGE_ADAPTOR_H - -#include <__config> -#include <__functional/compose.h> -#include <__functional/invoke.h> -#include <__ranges/concepts.h> -#include <__utility/forward.h> -#include <__utility/move.h> -#include <concepts> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -// CRTP base that one can derive from in order to be considered a range adaptor closure -// by the library. When deriving from this class, a pipe operator will be provided to -// make the following hold: -// - `x | f` is equivalent to `f(x)` -// - `f1 | f2` is an adaptor closure `g` such that `g(x)` is equivalent to `f2(f1(x))` -template <class _Tp> -struct __range_adaptor_closure; - -// Type that wraps an arbitrary function object and makes it into a range adaptor closure, -// i.e. something that can be called via the `x | f` notation. -template <class _Fn> -struct __range_adaptor_closure_t : _Fn, __range_adaptor_closure<__range_adaptor_closure_t<_Fn>> { - constexpr explicit __range_adaptor_closure_t(_Fn&& __f) : _Fn(std::move(__f)) { } -}; - -template <class _Tp> -concept _RangeAdaptorClosure = derived_from<remove_cvref_t<_Tp>, __range_adaptor_closure<remove_cvref_t<_Tp>>>; - -template <class _Tp> -struct __range_adaptor_closure { - template <ranges::viewable_range _View, _RangeAdaptorClosure _Closure> - requires same_as<_Tp, remove_cvref_t<_Closure>> && - invocable<_Closure, _View> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - friend constexpr decltype(auto) operator|(_View&& __view, _Closure&& __closure) - noexcept(is_nothrow_invocable_v<_Closure, _View>) - { return std::invoke(std::forward<_Closure>(__closure), std::forward<_View>(__view)); } - - template <_RangeAdaptorClosure _Closure, _RangeAdaptorClosure _OtherClosure> - requires same_as<_Tp, remove_cvref_t<_Closure>> && - constructible_from<decay_t<_Closure>, _Closure> && - constructible_from<decay_t<_OtherClosure>, _OtherClosure> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - friend constexpr auto operator|(_Closure&& __c1, _OtherClosure&& __c2) - noexcept(is_nothrow_constructible_v<decay_t<_Closure>, _Closure> && - is_nothrow_constructible_v<decay_t<_OtherClosure>, _OtherClosure>) - { return __range_adaptor_closure_t(std::__compose(std::forward<_OtherClosure>(__c2), std::forward<_Closure>(__c1))); } -}; - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_RANGE_ADAPTOR_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/rbegin.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/rbegin.h deleted file mode 100644 index cc4c0582cc2..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/rbegin.h +++ /dev/null @@ -1,130 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_RBEGIN_H -#define _LIBCPP___RANGES_RBEGIN_H - -#include <__concepts/class_or_enum.h> -#include <__concepts/same_as.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/readable_traits.h> -#include <__iterator/reverse_iterator.h> -#include <__ranges/access.h> -#include <__utility/auto_cast.h> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -// [ranges.access.rbegin] - -namespace ranges { -namespace __rbegin { -template <class _Tp> -concept __member_rbegin = - __can_borrow<_Tp> && - __workaround_52970<_Tp> && - requires(_Tp&& __t) { - { _LIBCPP_AUTO_CAST(__t.rbegin()) } -> input_or_output_iterator; - }; - -void rbegin(auto&) = delete; -void rbegin(const auto&) = delete; - -template <class _Tp> -concept __unqualified_rbegin = - !__member_rbegin<_Tp> && - __can_borrow<_Tp> && - __class_or_enum<remove_cvref_t<_Tp>> && - requires(_Tp&& __t) { - { _LIBCPP_AUTO_CAST(rbegin(__t)) } -> input_or_output_iterator; - }; - -template <class _Tp> -concept __can_reverse = - __can_borrow<_Tp> && - !__member_rbegin<_Tp> && - !__unqualified_rbegin<_Tp> && - requires(_Tp&& __t) { - { ranges::begin(__t) } -> same_as<decltype(ranges::end(__t))>; - { ranges::begin(__t) } -> bidirectional_iterator; - }; - -struct __fn { - template <class _Tp> - requires __member_rbegin<_Tp> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.rbegin()))) - { - return _LIBCPP_AUTO_CAST(__t.rbegin()); - } - - template <class _Tp> - requires __unqualified_rbegin<_Tp> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(_LIBCPP_AUTO_CAST(rbegin(__t)))) - { - return _LIBCPP_AUTO_CAST(rbegin(__t)); - } - - template <class _Tp> - requires __can_reverse<_Tp> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::end(__t))) - { - return std::make_reverse_iterator(ranges::end(__t)); - } - - void operator()(auto&&) const = delete; -}; -} // namespace __rbegin - -inline namespace __cpo { - inline constexpr auto rbegin = __rbegin::__fn{}; -} // namespace __cpo -} // namespace ranges - -// [range.access.crbegin] - -namespace ranges { -namespace __crbegin { -struct __fn { - template <class _Tp> - requires is_lvalue_reference_v<_Tp&&> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t)))) - -> decltype( ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t))) - { return ranges::rbegin(static_cast<const remove_reference_t<_Tp>&>(__t)); } - - template <class _Tp> - requires is_rvalue_reference_v<_Tp&&> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::rbegin(static_cast<const _Tp&&>(__t)))) - -> decltype( ranges::rbegin(static_cast<const _Tp&&>(__t))) - { return ranges::rbegin(static_cast<const _Tp&&>(__t)); } -}; -} // namespace __crbegin - -inline namespace __cpo { - inline constexpr auto crbegin = __crbegin::__fn{}; -} // namespace __cpo -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_RBEGIN_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h deleted file mode 100644 index 90fb5c18326..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/ref_view.h +++ /dev/null @@ -1,86 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_REF_VIEW_H -#define _LIBCPP___RANGES_REF_VIEW_H - -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/incrementable_traits.h> -#include <__iterator/iterator_traits.h> -#include <__memory/addressof.h> -#include <__ranges/access.h> -#include <__ranges/concepts.h> -#include <__ranges/data.h> -#include <__ranges/empty.h> -#include <__ranges/enable_borrowed_range.h> -#include <__ranges/size.h> -#include <__ranges/view_interface.h> -#include <__utility/forward.h> -#include <concepts> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - template<range _Range> - requires is_object_v<_Range> - class ref_view : public view_interface<ref_view<_Range>> { - _Range *__range_; - - static void __fun(_Range&); - static void __fun(_Range&&) = delete; - -public: - template<class _Tp> - requires __different_from<_Tp, ref_view> && - convertible_to<_Tp, _Range&> && requires { __fun(declval<_Tp>()); } - _LIBCPP_HIDE_FROM_ABI - constexpr ref_view(_Tp&& __t) - : __range_(std::addressof(static_cast<_Range&>(std::forward<_Tp>(__t)))) - {} - - _LIBCPP_HIDE_FROM_ABI constexpr _Range& base() const { return *__range_; } - - _LIBCPP_HIDE_FROM_ABI constexpr iterator_t<_Range> begin() const { return ranges::begin(*__range_); } - _LIBCPP_HIDE_FROM_ABI constexpr sentinel_t<_Range> end() const { return ranges::end(*__range_); } - - _LIBCPP_HIDE_FROM_ABI - constexpr bool empty() const - requires requires { ranges::empty(*__range_); } - { return ranges::empty(*__range_); } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() const - requires sized_range<_Range> - { return ranges::size(*__range_); } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto data() const - requires contiguous_range<_Range> - { return ranges::data(*__range_); } - }; - - template<class _Range> - ref_view(_Range&) -> ref_view<_Range>; - - template<class _Tp> - inline constexpr bool enable_borrowed_range<ref_view<_Tp>> = true; -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_REF_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h deleted file mode 100644 index cd7826021d4..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/rend.h +++ /dev/null @@ -1,134 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_REND_H -#define _LIBCPP___RANGES_REND_H - -#include <__concepts/class_or_enum.h> -#include <__concepts/same_as.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/readable_traits.h> -#include <__iterator/reverse_iterator.h> -#include <__ranges/access.h> -#include <__ranges/rbegin.h> -#include <__utility/auto_cast.h> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -// [range.access.rend] - -namespace ranges { -namespace __rend { -template <class _Tp> -concept __member_rend = - __can_borrow<_Tp> && - __workaround_52970<_Tp> && - requires(_Tp&& __t) { - ranges::rbegin(__t); - { _LIBCPP_AUTO_CAST(__t.rend()) } -> sentinel_for<decltype(ranges::rbegin(__t))>; - }; - -void rend(auto&) = delete; -void rend(const auto&) = delete; - -template <class _Tp> -concept __unqualified_rend = - !__member_rend<_Tp> && - __can_borrow<_Tp> && - __class_or_enum<remove_cvref_t<_Tp>> && - requires(_Tp&& __t) { - ranges::rbegin(__t); - { _LIBCPP_AUTO_CAST(rend(__t)) } -> sentinel_for<decltype(ranges::rbegin(__t))>; - }; - -template <class _Tp> -concept __can_reverse = - __can_borrow<_Tp> && - !__member_rend<_Tp> && - !__unqualified_rend<_Tp> && - requires(_Tp&& __t) { - { ranges::begin(__t) } -> same_as<decltype(ranges::end(__t))>; - { ranges::begin(__t) } -> bidirectional_iterator; - }; - -class __fn { -public: - template <class _Tp> - requires __member_rend<_Tp> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(_LIBCPP_AUTO_CAST(__t.rend()))) - { - return _LIBCPP_AUTO_CAST(__t.rend()); - } - - template <class _Tp> - requires __unqualified_rend<_Tp> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(_LIBCPP_AUTO_CAST(rend(__t)))) - { - return _LIBCPP_AUTO_CAST(rend(__t)); - } - - template <class _Tp> - requires __can_reverse<_Tp> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::begin(__t))) - { - return std::make_reverse_iterator(ranges::begin(__t)); - } - - void operator()(auto&&) const = delete; -}; -} // namespace __rend - -inline namespace __cpo { - inline constexpr auto rend = __rend::__fn{}; -} // namespace __cpo -} // namespace ranges - -// [range.access.crend] - -namespace ranges { -namespace __crend { -struct __fn { - template <class _Tp> - requires is_lvalue_reference_v<_Tp&&> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t)))) - -> decltype( ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t))) - { return ranges::rend(static_cast<const remove_reference_t<_Tp>&>(__t)); } - - template <class _Tp> - requires is_rvalue_reference_v<_Tp&&> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Tp&& __t) const - noexcept(noexcept(ranges::rend(static_cast<const _Tp&&>(__t)))) - -> decltype( ranges::rend(static_cast<const _Tp&&>(__t))) - { return ranges::rend(static_cast<const _Tp&&>(__t)); } -}; -} // namespace __crend - -inline namespace __cpo { - inline constexpr auto crend = __crend::__fn{}; -} // namespace __cpo -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_REND_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h deleted file mode 100644 index 59b8289a23f..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/reverse_view.h +++ /dev/null @@ -1,190 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_REVERSE_VIEW_H -#define _LIBCPP___RANGES_REVERSE_VIEW_H - -#include <__concepts/constructible.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/next.h> -#include <__iterator/reverse_iterator.h> -#include <__ranges/access.h> -#include <__ranges/all.h> -#include <__ranges/concepts.h> -#include <__ranges/enable_borrowed_range.h> -#include <__ranges/non_propagating_cache.h> -#include <__ranges/range_adaptor.h> -#include <__ranges/size.h> -#include <__ranges/subrange.h> -#include <__ranges/view_interface.h> -#include <__utility/forward.h> -#include <__utility/move.h> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - template<view _View> - requires bidirectional_range<_View> - class reverse_view : public view_interface<reverse_view<_View>> { - // We cache begin() whenever ranges::next is not guaranteed O(1) to provide an - // amortized O(1) begin() method. - static constexpr bool _UseCache = !random_access_range<_View> && !common_range<_View>; - using _Cache = _If<_UseCache, __non_propagating_cache<reverse_iterator<iterator_t<_View>>>, __empty_cache>; - _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache(); - _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); - - public: - _LIBCPP_HIDE_FROM_ABI - reverse_view() requires default_initializable<_View> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit reverse_view(_View __view) : __base_(std::move(__view)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr _View base() const& requires copy_constructible<_View> { return __base_; } - - _LIBCPP_HIDE_FROM_ABI - constexpr _View base() && { return std::move(__base_); } - - _LIBCPP_HIDE_FROM_ABI - constexpr reverse_iterator<iterator_t<_View>> begin() { - if constexpr (_UseCache) - if (__cached_begin_.__has_value()) - return *__cached_begin_; - - auto __tmp = std::make_reverse_iterator(ranges::next(ranges::begin(__base_), ranges::end(__base_))); - if constexpr (_UseCache) - __cached_begin_.__emplace(__tmp); - return __tmp; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr reverse_iterator<iterator_t<_View>> begin() requires common_range<_View> { - return std::make_reverse_iterator(ranges::end(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto begin() const requires common_range<const _View> { - return std::make_reverse_iterator(ranges::end(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr reverse_iterator<iterator_t<_View>> end() { - return std::make_reverse_iterator(ranges::begin(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto end() const requires common_range<const _View> { - return std::make_reverse_iterator(ranges::begin(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() requires sized_range<_View> { - return ranges::size(__base_); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() const requires sized_range<const _View> { - return ranges::size(__base_); - } - }; - - template<class _Range> - reverse_view(_Range&&) -> reverse_view<views::all_t<_Range>>; - - template<class _Tp> - inline constexpr bool enable_borrowed_range<reverse_view<_Tp>> = enable_borrowed_range<_Tp>; - - namespace views { - namespace __reverse { - template<class _Tp> - constexpr bool __is_reverse_view = false; - - template<class _Tp> - constexpr bool __is_reverse_view<reverse_view<_Tp>> = true; - - template<class _Tp> - constexpr bool __is_sized_reverse_subrange = false; - - template<class _Iter> - constexpr bool __is_sized_reverse_subrange<subrange<reverse_iterator<_Iter>, reverse_iterator<_Iter>, subrange_kind::sized>> = true; - - template<class _Tp> - constexpr bool __is_unsized_reverse_subrange = false; - - template<class _Iter, subrange_kind _Kind> - constexpr bool __is_unsized_reverse_subrange<subrange<reverse_iterator<_Iter>, reverse_iterator<_Iter>, _Kind>> = _Kind == subrange_kind::unsized; - - template<class _Tp> - struct __unwrapped_reverse_subrange { - using type = void; // avoid SFINAE-ing out the overload below -- let the concept requirements do it for better diagnostics - }; - - template<class _Iter, subrange_kind _Kind> - struct __unwrapped_reverse_subrange<subrange<reverse_iterator<_Iter>, reverse_iterator<_Iter>, _Kind>> { - using type = subrange<_Iter, _Iter, _Kind>; - }; - - struct __fn : __range_adaptor_closure<__fn> { - template<class _Range> - requires __is_reverse_view<remove_cvref_t<_Range>> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Range&& __range) const - noexcept(noexcept(std::forward<_Range>(__range).base())) - -> decltype( std::forward<_Range>(__range).base()) - { return std::forward<_Range>(__range).base(); } - - template<class _Range, - class _UnwrappedSubrange = typename __unwrapped_reverse_subrange<remove_cvref_t<_Range>>::type> - requires __is_sized_reverse_subrange<remove_cvref_t<_Range>> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Range&& __range) const - noexcept(noexcept(_UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size()))) - -> decltype( _UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size())) - { return _UnwrappedSubrange(__range.end().base(), __range.begin().base(), __range.size()); } - - template<class _Range, - class _UnwrappedSubrange = typename __unwrapped_reverse_subrange<remove_cvref_t<_Range>>::type> - requires __is_unsized_reverse_subrange<remove_cvref_t<_Range>> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Range&& __range) const - noexcept(noexcept(_UnwrappedSubrange(__range.end().base(), __range.begin().base()))) - -> decltype( _UnwrappedSubrange(__range.end().base(), __range.begin().base())) - { return _UnwrappedSubrange(__range.end().base(), __range.begin().base()); } - - template<class _Range> - requires (!__is_reverse_view<remove_cvref_t<_Range>> && - !__is_sized_reverse_subrange<remove_cvref_t<_Range>> && - !__is_unsized_reverse_subrange<remove_cvref_t<_Range>>) - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Range&& __range) const - noexcept(noexcept(reverse_view{std::forward<_Range>(__range)})) - -> decltype( reverse_view{std::forward<_Range>(__range)}) - { return reverse_view{std::forward<_Range>(__range)}; } - }; - } // namespace __reverse - - inline namespace __cpo { - inline constexpr auto reverse = __reverse::__fn{}; - } // namespace __cpo - } // namespace views -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_REVERSE_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h deleted file mode 100644 index 5347b78da91..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/single_view.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_SINGLE_VIEW_H -#define _LIBCPP___RANGES_SINGLE_VIEW_H - -#include <__config> -#include <__ranges/copyable_box.h> -#include <__ranges/view_interface.h> -#include <__utility/forward.h> -#include <__utility/in_place.h> -#include <__utility/move.h> -#include <concepts> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - template<copy_constructible _Tp> - requires is_object_v<_Tp> - class single_view : public view_interface<single_view<_Tp>> { - __copyable_box<_Tp> __value_; - - public: - _LIBCPP_HIDE_FROM_ABI - single_view() requires default_initializable<_Tp> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit single_view(const _Tp& __t) : __value_(in_place, __t) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit single_view(_Tp&& __t) : __value_(in_place, std::move(__t)) {} - - template<class... _Args> - requires constructible_from<_Tp, _Args...> - _LIBCPP_HIDE_FROM_ABI - constexpr explicit single_view(in_place_t, _Args&&... __args) - : __value_{in_place, std::forward<_Args>(__args)...} {} - - _LIBCPP_HIDE_FROM_ABI - constexpr _Tp* begin() noexcept { return data(); } - - _LIBCPP_HIDE_FROM_ABI - constexpr const _Tp* begin() const noexcept { return data(); } - - _LIBCPP_HIDE_FROM_ABI - constexpr _Tp* end() noexcept { return data() + 1; } - - _LIBCPP_HIDE_FROM_ABI - constexpr const _Tp* end() const noexcept { return data() + 1; } - - _LIBCPP_HIDE_FROM_ABI - static constexpr size_t size() noexcept { return 1; } - - _LIBCPP_HIDE_FROM_ABI - constexpr _Tp* data() noexcept { return __value_.operator->(); } - - _LIBCPP_HIDE_FROM_ABI - constexpr const _Tp* data() const noexcept { return __value_.operator->(); } - }; - - template<class _Tp> - single_view(_Tp) -> single_view<_Tp>; -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_SINGLE_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h deleted file mode 100644 index 4593205aefe..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/subrange.h +++ /dev/null @@ -1,289 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_SUBRANGE_H -#define _LIBCPP___RANGES_SUBRANGE_H - -#include <__concepts/constructible.h> -#include <__concepts/convertible_to.h> -#include <__concepts/copyable.h> -#include <__concepts/derived_from.h> -#include <__concepts/different_from.h> -#include <__config> -#include <__debug> -#include <__iterator/advance.h> -#include <__iterator/concepts.h> -#include <__iterator/incrementable_traits.h> -#include <__iterator/iterator_traits.h> -#include <__ranges/access.h> -#include <__ranges/concepts.h> -#include <__ranges/dangling.h> -#include <__ranges/enable_borrowed_range.h> -#include <__ranges/size.h> -#include <__ranges/view_interface.h> -#include <__tuple> -#include <__utility/move.h> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - template<class _From, class _To> - concept __uses_nonqualification_pointer_conversion = - is_pointer_v<_From> && is_pointer_v<_To> && - !convertible_to<remove_pointer_t<_From>(*)[], remove_pointer_t<_To>(*)[]>; - - template<class _From, class _To> - concept __convertible_to_non_slicing = - convertible_to<_From, _To> && - !__uses_nonqualification_pointer_conversion<decay_t<_From>, decay_t<_To>>; - - template<class _Tp> - concept __pair_like = - !is_reference_v<_Tp> && requires(_Tp __t) { - typename tuple_size<_Tp>::type; // Ensures `tuple_size<T>` is complete. - requires derived_from<tuple_size<_Tp>, integral_constant<size_t, 2>>; - typename tuple_element_t<0, remove_const_t<_Tp>>; - typename tuple_element_t<1, remove_const_t<_Tp>>; - { std::get<0>(__t) } -> convertible_to<const tuple_element_t<0, _Tp>&>; - { std::get<1>(__t) } -> convertible_to<const tuple_element_t<1, _Tp>&>; - }; - - template<class _Pair, class _Iter, class _Sent> - concept __pair_like_convertible_from = - !range<_Pair> && __pair_like<_Pair> && - constructible_from<_Pair, _Iter, _Sent> && - __convertible_to_non_slicing<_Iter, tuple_element_t<0, _Pair>> && - convertible_to<_Sent, tuple_element_t<1, _Pair>>; - - enum class _LIBCPP_ENUM_VIS subrange_kind : bool { unsized, sized }; - - template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent = _Iter, - subrange_kind _Kind = sized_sentinel_for<_Sent, _Iter> - ? subrange_kind::sized - : subrange_kind::unsized> - requires (_Kind == subrange_kind::sized || !sized_sentinel_for<_Sent, _Iter>) - class _LIBCPP_TEMPLATE_VIS subrange - : public view_interface<subrange<_Iter, _Sent, _Kind>> - { - private: - static constexpr bool _StoreSize = (_Kind == subrange_kind::sized && !sized_sentinel_for<_Sent, _Iter>); - static constexpr bool _MustProvideSizeAtConstruction = !_StoreSize; // just to improve compiler diagnostics - struct _Empty { constexpr _Empty(auto) noexcept { } }; - using _Size = conditional_t<_StoreSize, make_unsigned_t<iter_difference_t<_Iter>>, _Empty>; - _LIBCPP_NO_UNIQUE_ADDRESS _Iter __begin_ = _Iter(); - _LIBCPP_NO_UNIQUE_ADDRESS _Sent __end_ = _Sent(); - _LIBCPP_NO_UNIQUE_ADDRESS _Size __size_ = 0; - - public: - _LIBCPP_HIDE_FROM_ABI - subrange() requires default_initializable<_Iter> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr subrange(__convertible_to_non_slicing<_Iter> auto __iter, _Sent __sent) - requires _MustProvideSizeAtConstruction - : __begin_(std::move(__iter)), __end_(std::move(__sent)) - { } - - _LIBCPP_HIDE_FROM_ABI - constexpr subrange(__convertible_to_non_slicing<_Iter> auto __iter, _Sent __sent, - make_unsigned_t<iter_difference_t<_Iter>> __n) - requires (_Kind == subrange_kind::sized) - : __begin_(std::move(__iter)), __end_(std::move(__sent)), __size_(__n) - { - if constexpr (sized_sentinel_for<_Sent, _Iter>) - _LIBCPP_ASSERT((__end_ - __begin_) == static_cast<iter_difference_t<_Iter>>(__n), - "std::ranges::subrange was passed an invalid size hint"); - } - - template<__different_from<subrange> _Range> - requires borrowed_range<_Range> && - __convertible_to_non_slicing<iterator_t<_Range>, _Iter> && - convertible_to<sentinel_t<_Range>, _Sent> - _LIBCPP_HIDE_FROM_ABI - constexpr subrange(_Range&& __range) - requires (!_StoreSize) - : subrange(ranges::begin(__range), ranges::end(__range)) - { } - - template<__different_from<subrange> _Range> - requires borrowed_range<_Range> && - __convertible_to_non_slicing<iterator_t<_Range>, _Iter> && - convertible_to<sentinel_t<_Range>, _Sent> - _LIBCPP_HIDE_FROM_ABI - constexpr subrange(_Range&& __range) - requires _StoreSize && sized_range<_Range> - : subrange(__range, ranges::size(__range)) - { } - - template<borrowed_range _Range> - requires __convertible_to_non_slicing<iterator_t<_Range>, _Iter> && - convertible_to<sentinel_t<_Range>, _Sent> - _LIBCPP_HIDE_FROM_ABI - constexpr subrange(_Range&& __range, make_unsigned_t<iter_difference_t<_Iter>> __n) - requires (_Kind == subrange_kind::sized) - : subrange(ranges::begin(__range), ranges::end(__range), __n) - { } - - template<__different_from<subrange> _Pair> - requires __pair_like_convertible_from<_Pair, const _Iter&, const _Sent&> - _LIBCPP_HIDE_FROM_ABI - constexpr operator _Pair() const { - return _Pair(__begin_, __end_); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr _Iter begin() const requires copyable<_Iter> { - return __begin_; - } - - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Iter begin() requires (!copyable<_Iter>) { - return std::move(__begin_); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr _Sent end() const { - return __end_; - } - - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const { - return __begin_ == __end_; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr make_unsigned_t<iter_difference_t<_Iter>> size() const - requires (_Kind == subrange_kind::sized) - { - if constexpr (_StoreSize) - return __size_; - else - return std::__to_unsigned_like(__end_ - __begin_); - } - - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange next(iter_difference_t<_Iter> __n = 1) const& - requires forward_iterator<_Iter> - { - auto __tmp = *this; - __tmp.advance(__n); - return __tmp; - } - - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange next(iter_difference_t<_Iter> __n = 1) && { - advance(__n); - return std::move(*this); - } - - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr subrange prev(iter_difference_t<_Iter> __n = 1) const - requires bidirectional_iterator<_Iter> - { - auto __tmp = *this; - __tmp.advance(-__n); - return __tmp; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr subrange& advance(iter_difference_t<_Iter> __n) { - if constexpr (bidirectional_iterator<_Iter>) { - if (__n < 0) { - ranges::advance(__begin_, __n); - if constexpr (_StoreSize) - __size_ += std::__to_unsigned_like(-__n); - return *this; - } - } - - auto __d = __n - ranges::advance(__begin_, __n, __end_); - if constexpr (_StoreSize) - __size_ -= std::__to_unsigned_like(__d); - return *this; - } - }; - - template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent> - subrange(_Iter, _Sent) -> subrange<_Iter, _Sent>; - - template<input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent> - subrange(_Iter, _Sent, make_unsigned_t<iter_difference_t<_Iter>>) - -> subrange<_Iter, _Sent, subrange_kind::sized>; - - template<borrowed_range _Range> - subrange(_Range&&) -> subrange<iterator_t<_Range>, sentinel_t<_Range>, - (sized_range<_Range> || sized_sentinel_for<sentinel_t<_Range>, iterator_t<_Range>>) - ? subrange_kind::sized : subrange_kind::unsized>; - - template<borrowed_range _Range> - subrange(_Range&&, make_unsigned_t<range_difference_t<_Range>>) - -> subrange<iterator_t<_Range>, sentinel_t<_Range>, subrange_kind::sized>; - - template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind> - requires ((_Index == 0 && copyable<_Iter>) || _Index == 1) - _LIBCPP_HIDE_FROM_ABI - constexpr auto get(const subrange<_Iter, _Sent, _Kind>& __subrange) { - if constexpr (_Index == 0) - return __subrange.begin(); - else - return __subrange.end(); - } - - template<size_t _Index, class _Iter, class _Sent, subrange_kind _Kind> - requires (_Index < 2) - _LIBCPP_HIDE_FROM_ABI - constexpr auto get(subrange<_Iter, _Sent, _Kind>&& __subrange) { - if constexpr (_Index == 0) - return __subrange.begin(); - else - return __subrange.end(); - } - - template<class _Ip, class _Sp, subrange_kind _Kp> - inline constexpr bool enable_borrowed_range<subrange<_Ip, _Sp, _Kp>> = true; - - template<range _Rp> - using borrowed_subrange_t = _If<borrowed_range<_Rp>, subrange<iterator_t<_Rp>>, dangling>; -} // namespace ranges - -// [range.subrange.general] - -using ranges::get; - -// [ranges.syn] - -template<class _Ip, class _Sp, ranges::subrange_kind _Kp> -struct tuple_size<ranges::subrange<_Ip, _Sp, _Kp>> : integral_constant<size_t, 2> {}; - -template<class _Ip, class _Sp, ranges::subrange_kind _Kp> -struct tuple_element<0, ranges::subrange<_Ip, _Sp, _Kp>> { - using type = _Ip; -}; - -template<class _Ip, class _Sp, ranges::subrange_kind _Kp> -struct tuple_element<1, ranges::subrange<_Ip, _Sp, _Kp>> { - using type = _Sp; -}; - -template<class _Ip, class _Sp, ranges::subrange_kind _Kp> -struct tuple_element<0, const ranges::subrange<_Ip, _Sp, _Kp>> { - using type = _Ip; -}; - -template<class _Ip, class _Sp, ranges::subrange_kind _Kp> -struct tuple_element<1, const ranges::subrange<_Ip, _Sp, _Kp>> { - using type = _Sp; -}; - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_SUBRANGE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h deleted file mode 100644 index 0b0f9c3744f..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/take_view.h +++ /dev/null @@ -1,185 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_TAKE_VIEW_H -#define _LIBCPP___RANGES_TAKE_VIEW_H - -#include <__algorithm/min.h> -#include <__config> -#include <__iterator/concepts.h> -#include <__iterator/counted_iterator.h> -#include <__iterator/default_sentinel.h> -#include <__iterator/iterator_traits.h> -#include <__ranges/access.h> -#include <__ranges/all.h> -#include <__ranges/concepts.h> -#include <__ranges/enable_borrowed_range.h> -#include <__ranges/size.h> -#include <__ranges/view_interface.h> -#include <__utility/move.h> -#include <concepts> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - template<view _View> - class take_view : public view_interface<take_view<_View>> { - _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); - range_difference_t<_View> __count_ = 0; - - template<bool> class __sentinel; - - public: - _LIBCPP_HIDE_FROM_ABI - take_view() requires default_initializable<_View> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr take_view(_View __base, range_difference_t<_View> __count) - : __base_(std::move(__base)), __count_(__count) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr _View base() const& requires copy_constructible<_View> { return __base_; } - - _LIBCPP_HIDE_FROM_ABI - constexpr _View base() && { return std::move(__base_); } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto begin() requires (!__simple_view<_View>) { - if constexpr (sized_range<_View>) { - if constexpr (random_access_range<_View>) { - return ranges::begin(__base_); - } else { - using _DifferenceT = range_difference_t<_View>; - auto __size = size(); - return counted_iterator(ranges::begin(__base_), static_cast<_DifferenceT>(__size)); - } - } else { - return counted_iterator(ranges::begin(__base_), __count_); - } - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto begin() const requires range<const _View> { - if constexpr (sized_range<const _View>) { - if constexpr (random_access_range<const _View>) { - return ranges::begin(__base_); - } else { - using _DifferenceT = range_difference_t<const _View>; - auto __size = size(); - return counted_iterator(ranges::begin(__base_), static_cast<_DifferenceT>(__size)); - } - } else { - return counted_iterator(ranges::begin(__base_), __count_); - } - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto end() requires (!__simple_view<_View>) { - if constexpr (sized_range<_View>) { - if constexpr (random_access_range<_View>) { - return ranges::begin(__base_) + size(); - } else { - return default_sentinel; - } - } else { - return __sentinel<false>{ranges::end(__base_)}; - } - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto end() const requires range<const _View> { - if constexpr (sized_range<const _View>) { - if constexpr (random_access_range<const _View>) { - return ranges::begin(__base_) + size(); - } else { - return default_sentinel; - } - } else { - return __sentinel<true>{ranges::end(__base_)}; - } - } - - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() requires sized_range<_View> { - auto __n = ranges::size(__base_); - // TODO: use ranges::min here. - return std::min(__n, static_cast<decltype(__n)>(__count_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() const requires sized_range<const _View> { - auto __n = ranges::size(__base_); - // TODO: use ranges::min here. - return std::min(__n, static_cast<decltype(__n)>(__count_)); - } - }; - - template<view _View> - template<bool _Const> - class take_view<_View>::__sentinel { - using _Base = __maybe_const<_Const, _View>; - template<bool _OtherConst> - using _Iter = counted_iterator<iterator_t<__maybe_const<_OtherConst, _View>>>; - _LIBCPP_NO_UNIQUE_ADDRESS sentinel_t<_Base> __end_ = sentinel_t<_Base>(); - - template<bool> - friend class take_view<_View>::__sentinel; - -public: - _LIBCPP_HIDE_FROM_ABI - __sentinel() = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(std::move(__end)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr __sentinel(__sentinel<!_Const> __s) - requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>> - : __end_(std::move(__s.__end_)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr sentinel_t<_Base> base() const { return __end_; } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) { - return __lhs.count() == 0 || __lhs.base() == __rhs.__end_; - } - - template<bool _OtherConst = !_Const> - requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator==(const _Iter<_Const>& __lhs, const __sentinel& __rhs) { - return __lhs.count() == 0 || __lhs.base() == __rhs.__end_; - } - }; - - template<class _Range> - take_view(_Range&&, range_difference_t<_Range>) -> take_view<views::all_t<_Range>>; - - template<class _Tp> - inline constexpr bool enable_borrowed_range<take_view<_Tp>> = enable_borrowed_range<_Tp>; -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___RANGES_TAKE_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h deleted file mode 100644 index 42ea1b82c74..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/transform_view.h +++ /dev/null @@ -1,440 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_TRANSFORM_VIEW_H -#define _LIBCPP___RANGES_TRANSFORM_VIEW_H - -#include <__compare/three_way_comparable.h> -#include <__concepts/constructible.h> -#include <__concepts/convertible_to.h> -#include <__concepts/copyable.h> -#include <__concepts/derived_from.h> -#include <__concepts/equality_comparable.h> -#include <__concepts/invocable.h> -#include <__config> -#include <__functional/bind_back.h> -#include <__functional/invoke.h> -#include <__iterator/concepts.h> -#include <__iterator/iterator_traits.h> -#include <__memory/addressof.h> -#include <__ranges/access.h> -#include <__ranges/all.h> -#include <__ranges/concepts.h> -#include <__ranges/copyable_box.h> -#include <__ranges/empty.h> -#include <__ranges/range_adaptor.h> -#include <__ranges/size.h> -#include <__ranges/view_interface.h> -#include <__utility/forward.h> -#include <__utility/in_place.h> -#include <__utility/move.h> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - -template<class _Fn, class _View> -concept __regular_invocable_with_range_ref = - regular_invocable<_Fn, range_reference_t<_View>>; - -template<class _View, class _Fn> -concept __transform_view_constraints = - view<_View> && is_object_v<_Fn> && - regular_invocable<_Fn&, range_reference_t<_View>> && - __can_reference<invoke_result_t<_Fn&, range_reference_t<_View>>>; - -template<input_range _View, copy_constructible _Fn> - requires __transform_view_constraints<_View, _Fn> -class transform_view : public view_interface<transform_view<_View, _Fn>> { - template<bool> class __iterator; - template<bool> class __sentinel; - - _LIBCPP_NO_UNIQUE_ADDRESS __copyable_box<_Fn> __func_; - _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); - -public: - _LIBCPP_HIDE_FROM_ABI - transform_view() - requires default_initializable<_View> && default_initializable<_Fn> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr transform_view(_View __base, _Fn __func) - : __func_(std::in_place, std::move(__func)), __base_(std::move(__base)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr _View base() const& requires copy_constructible<_View> { return __base_; } - _LIBCPP_HIDE_FROM_ABI - constexpr _View base() && { return std::move(__base_); } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator<false> begin() { - return __iterator<false>{*this, ranges::begin(__base_)}; - } - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator<true> begin() const - requires range<const _View> && - __regular_invocable_with_range_ref<const _Fn&, const _View> - { - return __iterator<true>(*this, ranges::begin(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __sentinel<false> end() { - return __sentinel<false>(ranges::end(__base_)); - } - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator<false> end() - requires common_range<_View> - { - return __iterator<false>(*this, ranges::end(__base_)); - } - _LIBCPP_HIDE_FROM_ABI - constexpr __sentinel<true> end() const - requires range<const _View> && - __regular_invocable_with_range_ref<const _Fn&, const _View> - { - return __sentinel<true>(ranges::end(__base_)); - } - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator<true> end() const - requires common_range<const _View> && - __regular_invocable_with_range_ref<const _Fn&, const _View> - { - return __iterator<true>(*this, ranges::end(__base_)); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() requires sized_range<_View> { return ranges::size(__base_); } - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() const requires sized_range<const _View> { return ranges::size(__base_); } -}; - -template<class _Range, class _Fn> -transform_view(_Range&&, _Fn) -> transform_view<views::all_t<_Range>, _Fn>; - -template<class _View> -struct __transform_view_iterator_concept { using type = input_iterator_tag; }; - -template<random_access_range _View> -struct __transform_view_iterator_concept<_View> { using type = random_access_iterator_tag; }; - -template<bidirectional_range _View> -struct __transform_view_iterator_concept<_View> { using type = bidirectional_iterator_tag; }; - -template<forward_range _View> -struct __transform_view_iterator_concept<_View> { using type = forward_iterator_tag; }; - -template<class, class> -struct __transform_view_iterator_category_base {}; - -template<forward_range _View, class _Fn> -struct __transform_view_iterator_category_base<_View, _Fn> { - using _Cat = typename iterator_traits<iterator_t<_View>>::iterator_category; - - using iterator_category = conditional_t< - is_lvalue_reference_v<invoke_result_t<_Fn&, range_reference_t<_View>>>, - conditional_t< - derived_from<_Cat, contiguous_iterator_tag>, - random_access_iterator_tag, - _Cat - >, - input_iterator_tag - >; -}; - -template<input_range _View, copy_constructible _Fn> - requires __transform_view_constraints<_View, _Fn> -template<bool _Const> -class transform_view<_View, _Fn>::__iterator - : public __transform_view_iterator_category_base<_View, _Fn> { - - using _Parent = __maybe_const<_Const, transform_view>; - using _Base = __maybe_const<_Const, _View>; - - _Parent *__parent_ = nullptr; - - template<bool> - friend class transform_view<_View, _Fn>::__iterator; - - template<bool> - friend class transform_view<_View, _Fn>::__sentinel; - -public: - iterator_t<_Base> __current_ = iterator_t<_Base>(); - - using iterator_concept = typename __transform_view_iterator_concept<_View>::type; - using value_type = remove_cvref_t<invoke_result_t<_Fn&, range_reference_t<_Base>>>; - using difference_type = range_difference_t<_Base>; - - _LIBCPP_HIDE_FROM_ABI - __iterator() requires default_initializable<iterator_t<_Base>> = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator(_Parent& __parent, iterator_t<_Base> __current) - : __parent_(std::addressof(__parent)), __current_(std::move(__current)) {} - - // Note: `__i` should always be `__iterator<false>`, but directly using - // `__iterator<false>` is ill-formed when `_Const` is false - // (see http://wg21.link/class.copy.ctor#5). - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator(__iterator<!_Const> __i) - requires _Const && convertible_to<iterator_t<_View>, iterator_t<_Base>> - : __parent_(__i.__parent_), __current_(std::move(__i.__current_)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr const iterator_t<_Base>& base() const& noexcept { - return __current_; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr iterator_t<_Base> base() && { - return std::move(__current_); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr decltype(auto) operator*() const - noexcept(noexcept(std::invoke(*__parent_->__func_, *__current_))) - { - return std::invoke(*__parent_->__func_, *__current_); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator& operator++() { - ++__current_; - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr void operator++(int) { ++__current_; } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator operator++(int) - requires forward_range<_Base> - { - auto __tmp = *this; - ++*this; - return __tmp; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator& operator--() - requires bidirectional_range<_Base> - { - --__current_; - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator operator--(int) - requires bidirectional_range<_Base> - { - auto __tmp = *this; - --*this; - return __tmp; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator& operator+=(difference_type __n) - requires random_access_range<_Base> - { - __current_ += __n; - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr __iterator& operator-=(difference_type __n) - requires random_access_range<_Base> - { - __current_ -= __n; - return *this; - } - - _LIBCPP_HIDE_FROM_ABI - constexpr decltype(auto) operator[](difference_type __n) const - noexcept(noexcept(std::invoke(*__parent_->__func_, __current_[__n]))) - requires random_access_range<_Base> - { - return std::invoke(*__parent_->__func_, __current_[__n]); - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator==(const __iterator& __x, const __iterator& __y) - requires equality_comparable<iterator_t<_Base>> - { - return __x.__current_ == __y.__current_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator<(const __iterator& __x, const __iterator& __y) - requires random_access_range<_Base> - { - return __x.__current_ < __y.__current_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator>(const __iterator& __x, const __iterator& __y) - requires random_access_range<_Base> - { - return __x.__current_ > __y.__current_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator<=(const __iterator& __x, const __iterator& __y) - requires random_access_range<_Base> - { - return __x.__current_ <= __y.__current_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator>=(const __iterator& __x, const __iterator& __y) - requires random_access_range<_Base> - { - return __x.__current_ >= __y.__current_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y) - requires random_access_range<_Base> && three_way_comparable<iterator_t<_Base>> - { - return __x.__current_ <=> __y.__current_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr __iterator operator+(__iterator __i, difference_type __n) - requires random_access_range<_Base> - { - return __iterator{*__i.__parent_, __i.__current_ + __n}; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr __iterator operator+(difference_type __n, __iterator __i) - requires random_access_range<_Base> - { - return __iterator{*__i.__parent_, __i.__current_ + __n}; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr __iterator operator-(__iterator __i, difference_type __n) - requires random_access_range<_Base> - { - return __iterator{*__i.__parent_, __i.__current_ - __n}; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr difference_type operator-(const __iterator& __x, const __iterator& __y) - requires sized_sentinel_for<iterator_t<_Base>, iterator_t<_Base>> - { - return __x.__current_ - __y.__current_; - } - - _LIBCPP_HIDE_FROM_ABI - friend constexpr decltype(auto) iter_move(const __iterator& __i) - noexcept(noexcept(*__i)) - { - if constexpr (is_lvalue_reference_v<decltype(*__i)>) - return std::move(*__i); - else - return *__i; - } -}; - -template<input_range _View, copy_constructible _Fn> - requires __transform_view_constraints<_View, _Fn> -template<bool _Const> -class transform_view<_View, _Fn>::__sentinel { - using _Parent = __maybe_const<_Const, transform_view>; - using _Base = __maybe_const<_Const, _View>; - - sentinel_t<_Base> __end_ = sentinel_t<_Base>(); - - template<bool> - friend class transform_view<_View, _Fn>::__iterator; - - template<bool> - friend class transform_view<_View, _Fn>::__sentinel; - -public: - _LIBCPP_HIDE_FROM_ABI - __sentinel() = default; - - _LIBCPP_HIDE_FROM_ABI - constexpr explicit __sentinel(sentinel_t<_Base> __end) : __end_(__end) {} - - // Note: `__i` should always be `__sentinel<false>`, but directly using - // `__sentinel<false>` is ill-formed when `_Const` is false - // (see http://wg21.link/class.copy.ctor#5). - _LIBCPP_HIDE_FROM_ABI - constexpr __sentinel(__sentinel<!_Const> __i) - requires _Const && convertible_to<sentinel_t<_View>, sentinel_t<_Base>> - : __end_(std::move(__i.__end_)) {} - - _LIBCPP_HIDE_FROM_ABI - constexpr sentinel_t<_Base> base() const { return __end_; } - - template<bool _OtherConst> - requires sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> - _LIBCPP_HIDE_FROM_ABI - friend constexpr bool operator==(const __iterator<_OtherConst>& __x, const __sentinel& __y) { - return __x.__current_ == __y.__end_; - } - - template<bool _OtherConst> - requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> - _LIBCPP_HIDE_FROM_ABI - friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>> - operator-(const __iterator<_OtherConst>& __x, const __sentinel& __y) { - return __x.__current_ - __y.__end_; - } - - template<bool _OtherConst> - requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<__maybe_const<_OtherConst, _View>>> - _LIBCPP_HIDE_FROM_ABI - friend constexpr range_difference_t<__maybe_const<_OtherConst, _View>> - operator-(const __sentinel& __x, const __iterator<_OtherConst>& __y) { - return __x.__end_ - __y.__current_; - } -}; - -namespace views { -namespace __transform { - struct __fn { - template<class _Range, class _Fn> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Range&& __range, _Fn&& __f) const - noexcept(noexcept(transform_view(std::forward<_Range>(__range), std::forward<_Fn>(__f)))) - -> decltype( transform_view(std::forward<_Range>(__range), std::forward<_Fn>(__f))) - { return transform_view(std::forward<_Range>(__range), std::forward<_Fn>(__f)); } - - template<class _Fn> - requires constructible_from<decay_t<_Fn>, _Fn> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI - constexpr auto operator()(_Fn&& __f) const - noexcept(is_nothrow_constructible_v<decay_t<_Fn>, _Fn>) - { return __range_adaptor_closure_t(std::__bind_back(*this, std::forward<_Fn>(__f))); } - }; -} // namespace __transform - -inline namespace __cpo { - inline constexpr auto transform = __transform::__fn{}; -} // namespace __cpo -} // namespace views - -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_TRANSFORM_VIEW_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h deleted file mode 100644 index 91ae4bde7d1..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/view_interface.h +++ /dev/null @@ -1,195 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP___RANGES_VIEW_INTERFACE_H -#define _LIBCPP___RANGES_VIEW_INTERFACE_H - -#include <__config> -#include <__debug> -#include <__iterator/concepts.h> -#include <__iterator/iterator_traits.h> -#include <__iterator/prev.h> -#include <__memory/pointer_traits.h> -#include <__ranges/access.h> -#include <__ranges/concepts.h> -#include <__ranges/empty.h> -#include <concepts> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -namespace ranges { - -template<class _Tp> -concept __can_empty = requires(_Tp __t) { ranges::empty(__t); }; - -template<class _Tp> -void __implicitly_convert_to(type_identity_t<_Tp>) noexcept; - -template<class _Derived> - requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>> -class view_interface { - _LIBCPP_HIDE_FROM_ABI - constexpr _Derived& __derived() noexcept { - static_assert(sizeof(_Derived) && derived_from<_Derived, view_interface> && view<_Derived>); - return static_cast<_Derived&>(*this); - } - - _LIBCPP_HIDE_FROM_ABI - constexpr _Derived const& __derived() const noexcept { - static_assert(sizeof(_Derived) && derived_from<_Derived, view_interface> && view<_Derived>); - return static_cast<_Derived const&>(*this); - } - -public: - template<class _D2 = _Derived> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() - noexcept(noexcept(__implicitly_convert_to<bool>(ranges::begin(__derived()) == ranges::end(__derived())))) - requires forward_range<_D2> - { - return ranges::begin(__derived()) == ranges::end(__derived()); - } - - template<class _D2 = _Derived> - [[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool empty() const - noexcept(noexcept(__implicitly_convert_to<bool>(ranges::begin(__derived()) == ranges::end(__derived())))) - requires forward_range<const _D2> - { - return ranges::begin(__derived()) == ranges::end(__derived()); - } - - template<class _D2 = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr explicit operator bool() - noexcept(noexcept(ranges::empty(declval<_D2>()))) - requires __can_empty<_D2> - { - return !ranges::empty(__derived()); - } - - template<class _D2 = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr explicit operator bool() const - noexcept(noexcept(ranges::empty(declval<const _D2>()))) - requires __can_empty<const _D2> - { - return !ranges::empty(__derived()); - } - - template<class _D2 = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr auto data() - noexcept(noexcept(std::to_address(ranges::begin(__derived())))) - requires contiguous_iterator<iterator_t<_D2>> - { - return std::to_address(ranges::begin(__derived())); - } - - template<class _D2 = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr auto data() const - noexcept(noexcept(std::to_address(ranges::begin(__derived())))) - requires range<const _D2> && contiguous_iterator<iterator_t<const _D2>> - { - return std::to_address(ranges::begin(__derived())); - } - - template<class _D2 = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() - noexcept(noexcept(ranges::end(__derived()) - ranges::begin(__derived()))) - requires forward_range<_D2> - && sized_sentinel_for<sentinel_t<_D2>, iterator_t<_D2>> - { - return ranges::end(__derived()) - ranges::begin(__derived()); - } - - template<class _D2 = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr auto size() const - noexcept(noexcept(ranges::end(__derived()) - ranges::begin(__derived()))) - requires forward_range<const _D2> - && sized_sentinel_for<sentinel_t<const _D2>, iterator_t<const _D2>> - { - return ranges::end(__derived()) - ranges::begin(__derived()); - } - - template<class _D2 = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr decltype(auto) front() - noexcept(noexcept(*ranges::begin(__derived()))) - requires forward_range<_D2> - { - _LIBCPP_ASSERT(!empty(), - "Precondition `!empty()` not satisfied. `.front()` called on an empty view."); - return *ranges::begin(__derived()); - } - - template<class _D2 = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr decltype(auto) front() const - noexcept(noexcept(*ranges::begin(__derived()))) - requires forward_range<const _D2> - { - _LIBCPP_ASSERT(!empty(), - "Precondition `!empty()` not satisfied. `.front()` called on an empty view."); - return *ranges::begin(__derived()); - } - - template<class _D2 = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr decltype(auto) back() - noexcept(noexcept(*ranges::prev(ranges::end(__derived())))) - requires bidirectional_range<_D2> && common_range<_D2> - { - _LIBCPP_ASSERT(!empty(), - "Precondition `!empty()` not satisfied. `.back()` called on an empty view."); - return *ranges::prev(ranges::end(__derived())); - } - - template<class _D2 = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr decltype(auto) back() const - noexcept(noexcept(*ranges::prev(ranges::end(__derived())))) - requires bidirectional_range<const _D2> && common_range<const _D2> - { - _LIBCPP_ASSERT(!empty(), - "Precondition `!empty()` not satisfied. `.back()` called on an empty view."); - return *ranges::prev(ranges::end(__derived())); - } - - template<random_access_range _RARange = _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) - noexcept(noexcept(ranges::begin(__derived())[__index])) - { - return ranges::begin(__derived())[__index]; - } - - template<random_access_range _RARange = const _Derived> - _LIBCPP_HIDE_FROM_ABI - constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) const - noexcept(noexcept(ranges::begin(__derived())[__index])) - { - return ranges::begin(__derived())[__index]; - } -}; - -} // namespace ranges - -#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_VIEW_INTERFACE_H diff --git a/contrib/libs/cxxsupp/libcxx/include/__ranges/views.h b/contrib/libs/cxxsupp/libcxx/include/__ranges/views.h deleted file mode 100644 index 8cc5ba3d2ac..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__ranges/views.h +++ /dev/null @@ -1,35 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___RANGES_VIEWS -#define _LIBCPP___RANGES_VIEWS - -#include <__config> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) - -namespace ranges { - -namespace views { } - -} // namespace ranges - -namespace views = ranges::views; - -#endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___RANGES_VIEWS diff --git a/contrib/libs/cxxsupp/libcxx/include/__support/solaris/floatingpoint.h b/contrib/libs/cxxsupp/libcxx/include/__support/solaris/floatingpoint.h deleted file mode 100644 index 5f1628fbe4f..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__support/solaris/floatingpoint.h +++ /dev/null @@ -1,13 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#define atof sun_atof -#define strtod sun_strtod -#include_next "floatingpoint.h" -#undef atof -#undef strtod diff --git a/contrib/libs/cxxsupp/libcxx/include/__support/solaris/wchar.h b/contrib/libs/cxxsupp/libcxx/include/__support/solaris/wchar.h deleted file mode 100644 index f01fd743a23..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/__support/solaris/wchar.h +++ /dev/null @@ -1,46 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#define iswalpha sun_iswalpha -#define iswupper sun_iswupper -#define iswlower sun_iswlower -#define iswdigit sun_iswdigit -#define iswxdigit sun_iswxdigit -#define iswalnum sun_iswalnum -#define iswspace sun_iswspace -#define iswpunct sun_iswpunct -#define iswprint sun_iswprint -#define iswgraph sun_iswgraph -#define iswcntrl sun_iswcntrl -#define iswctype sun_iswctype -#define towlower sun_towlower -#define towupper sun_towupper -#define wcswcs sun_wcswcs -#define wcswidth sun_wcswidth -#define wcwidth sun_wcwidth -#define wctype sun_wctype -#define _WCHAR_T 1 -#include_next "wchar.h" -#undef iswalpha -#undef iswupper -#undef iswlower -#undef iswdigit -#undef iswxdigit -#undef iswalnum -#undef iswspace -#undef iswpunct -#undef iswprint -#undef iswgraph -#undef iswcntrl -#undef iswctype -#undef towlower -#undef towupper -#undef wcswcs -#undef wcswidth -#undef wcwidth -#undef wctype diff --git a/contrib/libs/cxxsupp/libcxx/include/coroutine b/contrib/libs/cxxsupp/libcxx/include/coroutine deleted file mode 100644 index 478f4723f9a..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/coroutine +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_COROUTINE -#define _LIBCPP_COROUTINE - -/** - coroutine synopsis - -namespace std { -// [coroutine.traits] -template <class R, class... ArgTypes> - struct coroutine_traits; -// [coroutine.handle] -template <class Promise = void> - struct coroutine_handle; -// [coroutine.handle.compare] -constexpr bool operator==(coroutine_handle<> x, coroutine_handle<> y) noexcept; -constexpr strong_ordering operator<=>(coroutine_handle<> x, coroutine_handle<> y) noexcept; -// [coroutine.handle.hash] -template <class T> struct hash; -template <class P> struct hash<coroutine_handle<P>>; -// [coroutine.noop] -struct noop_coroutine_promise; -template<> struct coroutine_handle<noop_coroutine_promise>; -using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>; -noop_coroutine_handle noop_coroutine() noexcept; -// [coroutine.trivial.awaitables] -struct suspend_never; -struct suspend_always; -} // namespace std - - */ - -#include <__config> -#include <__coroutine/coroutine_handle.h> -#include <__coroutine/coroutine_traits.h> -#include <__coroutine/noop_coroutine_handle.h> -#include <__coroutine/trivial_awaitables.h> -#include <version> - -#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -# pragma GCC system_header -#endif - -#endif // _LIBCPP_COROUTINE diff --git a/contrib/libs/cxxsupp/libcxx/include/csetjmp b/contrib/libs/cxxsupp/libcxx/include/csetjmp deleted file mode 100644 index 76cbaab4c38..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/csetjmp +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_CSETJMP -#define _LIBCPP_CSETJMP - -/* - csetjmp synopsis - -Macros: - - setjmp - -namespace std -{ - -Types: - - jmp_buf - -void longjmp(jmp_buf env, int val); - -} // std - -*/ - -#include <__config> -#include <setjmp.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -using ::jmp_buf _LIBCPP_USING_IF_EXISTS; -using ::longjmp _LIBCPP_USING_IF_EXISTS; - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_CSETJMP diff --git a/contrib/libs/cxxsupp/libcxx/include/cstdbool b/contrib/libs/cxxsupp/libcxx/include/cstdbool deleted file mode 100644 index ef731c021a4..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/cstdbool +++ /dev/null @@ -1,31 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_CSTDBOOL -#define _LIBCPP_CSTDBOOL - -/* - cstdbool synopsis - -Macros: - - __bool_true_false_are_defined - -*/ - -#include <__config> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#undef __bool_true_false_are_defined -#define __bool_true_false_are_defined 1 - -#endif // _LIBCPP_CSTDBOOL diff --git a/contrib/libs/cxxsupp/libcxx/include/ctgmath b/contrib/libs/cxxsupp/libcxx/include/ctgmath deleted file mode 100644 index 6237979be49..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/ctgmath +++ /dev/null @@ -1,28 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_CTGMATH -#define _LIBCPP_CTGMATH - -/* - ctgmath synopsis - -#include <ccomplex> -#include <cmath> - -*/ - -#include <ccomplex> -#include <cmath> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#endif // _LIBCPP_CTGMATH diff --git a/contrib/libs/cxxsupp/libcxx/include/execution b/contrib/libs/cxxsupp/libcxx/include/execution deleted file mode 100644 index a82830519ae..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/execution +++ /dev/null @@ -1,24 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXECUTION -#define _LIBCPP_EXECUTION - -#include <__config> -#include <version> - -#if defined(_LIBCPP_HAS_PARALLEL_ALGORITHMS) && _LIBCPP_STD_VER >= 17 -//# include <__pstl_execution> -#endif - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#endif // _LIBCPP_EXECUTION diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/__memory b/contrib/libs/cxxsupp/libcxx/include/experimental/__memory deleted file mode 100644 index 749cf4c0c65..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/__memory +++ /dev/null @@ -1,117 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL___MEMORY -#define _LIBCPP_EXPERIMENTAL___MEMORY - -#include <__memory/allocator_arg_t.h> -#include <__memory/uses_allocator.h> -#include <experimental/__config> -#include <experimental/utility> // for erased_type -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS - -template < - class _Tp, class _Alloc - , bool = uses_allocator<_Tp, _Alloc>::value - , bool = __has_allocator_type<_Tp>::value - > -struct __lfts_uses_allocator : public false_type {}; - -template <class _Tp, class _Alloc> -struct __lfts_uses_allocator<_Tp, _Alloc, false, false> : public false_type {}; - -template <class _Tp, class _Alloc, bool HasAlloc> -struct __lfts_uses_allocator<_Tp, _Alloc, true, HasAlloc> : public true_type {}; - -template <class _Tp, class _Alloc> -struct __lfts_uses_allocator<_Tp, _Alloc, false, true> - : public integral_constant<bool - , is_convertible<_Alloc, typename _Tp::allocator_type>::value - || is_same<erased_type, typename _Tp::allocator_type>::value - > -{}; - -template <bool _UsesAlloc, class _Tp, class _Alloc, class ..._Args> -struct __lfts_uses_alloc_ctor_imp -{ - static const int value = 0; -}; - -template <class _Tp, class _Alloc, class ..._Args> -struct __lfts_uses_alloc_ctor_imp<true, _Tp, _Alloc, _Args...> -{ - static const bool __ic_first - = is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; - - static const bool __ic_second = - conditional< - __ic_first, - false_type, - is_constructible<_Tp, _Args..., _Alloc> - >::type::value; - - static_assert(__ic_first || __ic_second, - "Request for uses allocator construction is ill-formed"); - - static const int value = __ic_first ? 1 : 2; -}; - -template <class _Tp, class _Alloc, class ..._Args> -struct __lfts_uses_alloc_ctor - : integral_constant<int, - __lfts_uses_alloc_ctor_imp< - __lfts_uses_allocator<_Tp, _Alloc>::value - , _Tp, _Alloc, _Args... - >::value - > -{}; - -template <class _Tp, class _Allocator, class... _Args> -inline _LIBCPP_INLINE_VISIBILITY -void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args ) -{ - new (__storage) _Tp (_VSTD::forward<_Args>(__args)...); -} - -// FIXME: This should have a version which takes a non-const alloc. -template <class _Tp, class _Allocator, class... _Args> -inline _LIBCPP_INLINE_VISIBILITY -void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) -{ - new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...); -} - -// FIXME: This should have a version which takes a non-const alloc. -template <class _Tp, class _Allocator, class... _Args> -inline _LIBCPP_INLINE_VISIBILITY -void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) -{ - new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a); -} - -template <class _Tp, class _Alloc, class ..._Args> -inline _LIBCPP_INLINE_VISIBILITY -void __lfts_user_alloc_construct( - _Tp * __store, const _Alloc & __a, _Args &&... __args) -{ - ::std::experimental::fundamentals_v1::__user_alloc_construct_impl( - typename __lfts_uses_alloc_ctor<_Tp, _Alloc, _Args...>::type() - , __store, __a, _VSTD::forward<_Args>(__args)... - ); -} - -_LIBCPP_END_NAMESPACE_LFTS - -#endif /* _LIBCPP_EXPERIMENTAL___MEMORY */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/algorithm b/contrib/libs/cxxsupp/libcxx/include/experimental/algorithm deleted file mode 100644 index b9405bfe5ff..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/algorithm +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_ALGORITHM -#define _LIBCPP_EXPERIMENTAL_ALGORITHM - -/* - experimental/algorithm synopsis - -#include <algorithm> - -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { - -template <class ForwardIterator, class Searcher> -ForwardIterator search(ForwardIterator first, ForwardIterator last, - const Searcher &searcher); - -// sample removed because it's now part of C++17 - -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - -*/ - -#include <__debug> -#include <algorithm> -#include <experimental/__config> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS - -template <class _ForwardIterator, class _Searcher> -_LIBCPP_INLINE_VISIBILITY -_ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s) -{ return __s(__f, __l).first; } - -_LIBCPP_END_NAMESPACE_LFTS - -#endif /* _LIBCPP_EXPERIMENTAL_ALGORITHM */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/coroutine b/contrib/libs/cxxsupp/libcxx/include/experimental/coroutine deleted file mode 100644 index d14bd26401f..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/coroutine +++ /dev/null @@ -1,334 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_COROUTINE -#define _LIBCPP_EXPERIMENTAL_COROUTINE - -/** - experimental/coroutine synopsis - -// C++next - -namespace std { -namespace experimental { -inline namespace coroutines_v1 { - - // 18.11.1 coroutine traits -template <typename R, typename... ArgTypes> -class coroutine_traits; -// 18.11.2 coroutine handle -template <typename Promise = void> -class coroutine_handle; -// 18.11.2.7 comparison operators: -bool operator==(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; -bool operator!=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; -bool operator<(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; -bool operator<=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; -bool operator>=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; -bool operator>(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT; -// 18.11.3 trivial awaitables -struct suspend_never; -struct suspend_always; -// 18.11.2.8 hash support: -template <class T> struct hash; -template <class P> struct hash<coroutine_handle<P>>; - -} // namespace coroutines_v1 -} // namespace experimental -} // namespace std - - */ - -#include <__debug> -#include <cstddef> -#include <experimental/__config> -#include <functional> -#include <memory> // for hash<T*> -#include <new> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#ifdef _LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES -# if defined(_LIBCPP_WARNING) - _LIBCPP_WARNING("<experimental/coroutine> cannot be used with this compiler") -# else -# warning <experimental/coroutine> cannot be used with this compiler -# endif -#endif - -#ifndef _LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES - -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES - -template <class _Tp, class = void> -struct __coroutine_traits_sfinae {}; - -template <class _Tp> -struct __coroutine_traits_sfinae< - _Tp, typename __void_t<typename _Tp::promise_type>::type> -{ - using promise_type = typename _Tp::promise_type; -}; - -template <typename _Ret, typename... _Args> -struct coroutine_traits - : public __coroutine_traits_sfinae<_Ret> -{ -}; - -template <typename _Promise = void> -class _LIBCPP_TEMPLATE_VIS coroutine_handle; - -template <> -class _LIBCPP_TEMPLATE_VIS coroutine_handle<void> { -public: - _LIBCPP_INLINE_VISIBILITY - _LIBCPP_CONSTEXPR coroutine_handle() _NOEXCEPT : __handle_(nullptr) {} - - _LIBCPP_INLINE_VISIBILITY - _LIBCPP_CONSTEXPR coroutine_handle(nullptr_t) _NOEXCEPT : __handle_(nullptr) {} - - _LIBCPP_INLINE_VISIBILITY - coroutine_handle& operator=(nullptr_t) _NOEXCEPT { - __handle_ = nullptr; - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - _LIBCPP_CONSTEXPR void* address() const _NOEXCEPT { return __handle_; } - - _LIBCPP_INLINE_VISIBILITY - _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return __handle_; } - - _LIBCPP_INLINE_VISIBILITY - void operator()() { resume(); } - - _LIBCPP_INLINE_VISIBILITY - void resume() { - _LIBCPP_ASSERT(__is_suspended(), - "resume() can only be called on suspended coroutines"); - _LIBCPP_ASSERT(!done(), - "resume() has undefined behavior when the coroutine is done"); - __builtin_coro_resume(__handle_); - } - - _LIBCPP_INLINE_VISIBILITY - void destroy() { - _LIBCPP_ASSERT(__is_suspended(), - "destroy() can only be called on suspended coroutines"); - __builtin_coro_destroy(__handle_); - } - - _LIBCPP_INLINE_VISIBILITY - bool done() const { - _LIBCPP_ASSERT(__is_suspended(), - "done() can only be called on suspended coroutines"); - return __builtin_coro_done(__handle_); - } - -public: - _LIBCPP_INLINE_VISIBILITY - static coroutine_handle from_address(void* __addr) _NOEXCEPT { - coroutine_handle __tmp; - __tmp.__handle_ = __addr; - return __tmp; - } - - // FIXME: Should from_address(nullptr) be allowed? - _LIBCPP_INLINE_VISIBILITY - static coroutine_handle from_address(nullptr_t) _NOEXCEPT { - return coroutine_handle(nullptr); - } - - template <class _Tp, bool _CallIsValid = false> - static coroutine_handle from_address(_Tp*) { - static_assert(_CallIsValid, - "coroutine_handle<void>::from_address cannot be called with " - "non-void pointers"); - } - -private: - bool __is_suspended() const _NOEXCEPT { - // FIXME actually implement a check for if the coro is suspended. - return __handle_; - } - - template <class _PromiseT> friend class coroutine_handle; - void* __handle_; -}; - -// 18.11.2.7 comparison operators: -inline _LIBCPP_INLINE_VISIBILITY -bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { - return __x.address() == __y.address(); -} -inline _LIBCPP_INLINE_VISIBILITY -bool operator!=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { - return !(__x == __y); -} -inline _LIBCPP_INLINE_VISIBILITY -bool operator<(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { - return less<void*>()(__x.address(), __y.address()); -} -inline _LIBCPP_INLINE_VISIBILITY -bool operator>(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { - return __y < __x; -} -inline _LIBCPP_INLINE_VISIBILITY -bool operator<=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { - return !(__x > __y); -} -inline _LIBCPP_INLINE_VISIBILITY -bool operator>=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT { - return !(__x < __y); -} - -template <typename _Promise> -class _LIBCPP_TEMPLATE_VIS coroutine_handle : public coroutine_handle<> { - using _Base = coroutine_handle<>; -public: -#ifndef _LIBCPP_CXX03_LANG - // 18.11.2.1 construct/reset - using coroutine_handle<>::coroutine_handle; -#else - _LIBCPP_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT : _Base() {} - _LIBCPP_INLINE_VISIBILITY coroutine_handle(nullptr_t) _NOEXCEPT : _Base(nullptr) {} -#endif - _LIBCPP_INLINE_VISIBILITY - coroutine_handle& operator=(nullptr_t) _NOEXCEPT { - _Base::operator=(nullptr); - return *this; - } - - _LIBCPP_INLINE_VISIBILITY - _Promise& promise() const { - return *static_cast<_Promise*>( - __builtin_coro_promise(this->__handle_, _LIBCPP_ALIGNOF(_Promise), false)); - } - -public: - _LIBCPP_INLINE_VISIBILITY - static coroutine_handle from_address(void* __addr) _NOEXCEPT { - coroutine_handle __tmp; - __tmp.__handle_ = __addr; - return __tmp; - } - - // NOTE: this overload isn't required by the standard but is needed so - // the deleted _Promise* overload doesn't make from_address(nullptr) - // ambiguous. - // FIXME: should from_address work with nullptr? - _LIBCPP_INLINE_VISIBILITY - static coroutine_handle from_address(nullptr_t) _NOEXCEPT { - return coroutine_handle(nullptr); - } - - template <class _Tp, bool _CallIsValid = false> - static coroutine_handle from_address(_Tp*) { - static_assert(_CallIsValid, - "coroutine_handle<promise_type>::from_address cannot be called with " - "non-void pointers"); - } - - template <bool _CallIsValid = false> - static coroutine_handle from_address(_Promise*) { - static_assert(_CallIsValid, - "coroutine_handle<promise_type>::from_address cannot be used with " - "pointers to the coroutine's promise type; use 'from_promise' instead"); - } - - _LIBCPP_INLINE_VISIBILITY - static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT { - typedef typename remove_cv<_Promise>::type _RawPromise; - coroutine_handle __tmp; - __tmp.__handle_ = __builtin_coro_promise( - _VSTD::addressof(const_cast<_RawPromise&>(__promise)), - _LIBCPP_ALIGNOF(_Promise), true); - return __tmp; - } -}; - -#if __has_builtin(__builtin_coro_noop) -struct noop_coroutine_promise {}; - -template <> -class _LIBCPP_TEMPLATE_VIS coroutine_handle<noop_coroutine_promise> - : public coroutine_handle<> { - using _Base = coroutine_handle<>; - using _Promise = noop_coroutine_promise; -public: - - _LIBCPP_INLINE_VISIBILITY - _Promise& promise() const { - return *static_cast<_Promise*>( - __builtin_coro_promise(this->__handle_, _LIBCPP_ALIGNOF(_Promise), false)); - } - - _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return true; } - _LIBCPP_CONSTEXPR bool done() const _NOEXCEPT { return false; } - - _LIBCPP_CONSTEXPR_AFTER_CXX17 void operator()() const _NOEXCEPT {} - _LIBCPP_CONSTEXPR_AFTER_CXX17 void resume() const _NOEXCEPT {} - _LIBCPP_CONSTEXPR_AFTER_CXX17 void destroy() const _NOEXCEPT {} - -private: - _LIBCPP_INLINE_VISIBILITY - friend coroutine_handle<noop_coroutine_promise> noop_coroutine() _NOEXCEPT; - - _LIBCPP_INLINE_VISIBILITY coroutine_handle() _NOEXCEPT { - this->__handle_ = __builtin_coro_noop(); - } -}; - -using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>; - -inline _LIBCPP_INLINE_VISIBILITY -noop_coroutine_handle noop_coroutine() _NOEXCEPT { - return noop_coroutine_handle(); -} -#endif // __has_builtin(__builtin_coro_noop) - -struct suspend_never { - _LIBCPP_INLINE_VISIBILITY - bool await_ready() const _NOEXCEPT { return true; } - _LIBCPP_INLINE_VISIBILITY - void await_suspend(coroutine_handle<>) const _NOEXCEPT {} - _LIBCPP_INLINE_VISIBILITY - void await_resume() const _NOEXCEPT {} -}; - -struct suspend_always { - _LIBCPP_INLINE_VISIBILITY - bool await_ready() const _NOEXCEPT { return false; } - _LIBCPP_INLINE_VISIBILITY - void await_suspend(coroutine_handle<>) const _NOEXCEPT {} - _LIBCPP_INLINE_VISIBILITY - void await_resume() const _NOEXCEPT {} -}; - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Tp> -struct hash<_VSTD_CORO::coroutine_handle<_Tp> > { - using __arg_type = _VSTD_CORO::coroutine_handle<_Tp>; - _LIBCPP_INLINE_VISIBILITY - size_t operator()(__arg_type const& __v) const _NOEXCEPT - {return hash<void*>()(__v.address());} -}; - -_LIBCPP_END_NAMESPACE_STD - -#endif // !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES) - -#endif /* _LIBCPP_EXPERIMENTAL_COROUTINE */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/deque b/contrib/libs/cxxsupp/libcxx/include/experimental/deque deleted file mode 100644 index 1809991b473..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/deque +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_DEQUE -#define _LIBCPP_EXPERIMENTAL_DEQUE -/* - experimental/deque synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - template <class T> - using deque = std::deque<T,polymorphic_allocator<T>>; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <deque> -#include <experimental/__config> -#include <experimental/memory_resource> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _ValueT> -using deque = _VSTD::deque<_ValueT, polymorphic_allocator<_ValueT>>; - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_DEQUE */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/filesystem b/contrib/libs/cxxsupp/libcxx/include/experimental/filesystem deleted file mode 100644 index 8b137891791..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/filesystem +++ /dev/null @@ -1 +0,0 @@ - diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/forward_list b/contrib/libs/cxxsupp/libcxx/include/experimental/forward_list deleted file mode 100644 index 675ae0656aa..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/forward_list +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_FORWARD_LIST -#define _LIBCPP_EXPERIMENTAL_FORWARD_LIST -/* - experimental/forward_list synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - template <class T> - using forward_list = std::forward_list<T,polymorphic_allocator<T>>; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <experimental/memory_resource> -#include <forward_list> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _ValueT> -using forward_list = _VSTD::forward_list<_ValueT, polymorphic_allocator<_ValueT>>; - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_FORWARD_LIST */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/functional b/contrib/libs/cxxsupp/libcxx/include/experimental/functional deleted file mode 100644 index de21ab69824..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/functional +++ /dev/null @@ -1,430 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_FUNCTIONAL -#define _LIBCPP_EXPERIMENTAL_FUNCTIONAL - -/* - experimental/functional synopsis - -#include <algorithm> - -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { - // 4.3, Searchers - template<class ForwardIterator, class BinaryPredicate = equal_to<>> - class default_searcher; - - template<class RandomAccessIterator, - class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>, - class BinaryPredicate = equal_to<>> - class boyer_moore_searcher; - - template<class RandomAccessIterator, - class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>, - class BinaryPredicate = equal_to<>> - class boyer_moore_horspool_searcher; - - template<class ForwardIterator, class BinaryPredicate = equal_to<>> - default_searcher<ForwardIterator, BinaryPredicate> - make_default_searcher(ForwardIterator pat_first, ForwardIterator pat_last, - BinaryPredicate pred = BinaryPredicate()); - - template<class RandomAccessIterator, - class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>, - class BinaryPredicate = equal_to<>> - boyer_moore_searcher<RandomAccessIterator, Hash, BinaryPredicate> - make_boyer_moore_searcher( - RandomAccessIterator pat_first, RandomAccessIterator pat_last, - Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); - - template<class RandomAccessIterator, - class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>, - class BinaryPredicate = equal_to<>> - boyer_moore_horspool_searcher<RandomAccessIterator, Hash, BinaryPredicate> - make_boyer_moore_horspool_searcher( - RandomAccessIterator pat_first, RandomAccessIterator pat_last, - Hash hf = Hash(), BinaryPredicate pred = BinaryPredicate()); - - } // namespace fundamentals_v1 - } // namespace experimental - -} // namespace std - -*/ - -#include <__debug> -#include <__memory/uses_allocator.h> -#include <algorithm> -#include <array> -#include <experimental/__config> -#include <functional> -#include <type_traits> -#include <unordered_map> -#include <vector> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_LFTS - -#if _LIBCPP_STD_VER > 11 -// default searcher -template<class _ForwardIterator, class _BinaryPredicate = equal_to<>> -class _LIBCPP_TEMPLATE_VIS default_searcher { -public: - _LIBCPP_INLINE_VISIBILITY - default_searcher(_ForwardIterator __f, _ForwardIterator __l, - _BinaryPredicate __p = _BinaryPredicate()) - : __first_(__f), __last_(__l), __pred_(__p) {} - - template <typename _ForwardIterator2> - _LIBCPP_INLINE_VISIBILITY - pair<_ForwardIterator2, _ForwardIterator2> - operator () (_ForwardIterator2 __f, _ForwardIterator2 __l) const - { - return _VSTD::__search(__f, __l, __first_, __last_, __pred_, - typename iterator_traits<_ForwardIterator>::iterator_category(), - typename iterator_traits<_ForwardIterator2>::iterator_category()); - } - -private: - _ForwardIterator __first_; - _ForwardIterator __last_; - _BinaryPredicate __pred_; - }; - -template<class _ForwardIterator, class _BinaryPredicate = equal_to<>> -_LIBCPP_INLINE_VISIBILITY -default_searcher<_ForwardIterator, _BinaryPredicate> -make_default_searcher( _ForwardIterator __f, _ForwardIterator __l, _BinaryPredicate __p = _BinaryPredicate ()) -{ - return default_searcher<_ForwardIterator, _BinaryPredicate>(__f, __l, __p); -} - -template<class _Key, class _Value, class _Hash, class _BinaryPredicate, bool /*useArray*/> class _BMSkipTable; - -// General case for BM data searching; use a map -template<class _Key, typename _Value, class _Hash, class _BinaryPredicate> -class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, false> { - typedef _Value value_type; - typedef _Key key_type; - - const _Value __default_value_; - std::unordered_map<_Key, _Value, _Hash, _BinaryPredicate> __table; - -public: - _LIBCPP_INLINE_VISIBILITY - _BMSkipTable(size_t __sz, _Value __default, _Hash __hf, _BinaryPredicate __pred) - : __default_value_(__default), __table(__sz, __hf, __pred) {} - - _LIBCPP_INLINE_VISIBILITY - void insert(const key_type &__key, value_type __val) - { - __table [__key] = __val; // Would skip_.insert (val) be better here? - } - - _LIBCPP_INLINE_VISIBILITY - value_type operator [](const key_type & __key) const - { - auto __it = __table.find (__key); - return __it == __table.end() ? __default_value_ : __it->second; - } -}; - - -// Special case small numeric values; use an array -template<class _Key, typename _Value, class _Hash, class _BinaryPredicate> -class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, true> { -private: - typedef _Value value_type; - typedef _Key key_type; - - typedef typename make_unsigned<key_type>::type unsigned_key_type; - typedef std::array<value_type, numeric_limits<unsigned_key_type>::max()> skip_map; - skip_map __table; - -public: - _LIBCPP_INLINE_VISIBILITY - _BMSkipTable(size_t /*__sz*/, _Value __default, _Hash /*__hf*/, _BinaryPredicate /*__pred*/) - { - std::fill_n(__table.begin(), __table.size(), __default); - } - - _LIBCPP_INLINE_VISIBILITY - void insert(key_type __key, value_type __val) - { - __table[static_cast<unsigned_key_type>(__key)] = __val; - } - - _LIBCPP_INLINE_VISIBILITY - value_type operator [](key_type __key) const - { - return __table[static_cast<unsigned_key_type>(__key)]; - } -}; - - -template <class _RandomAccessIterator1, - class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>, - class _BinaryPredicate = equal_to<>> -class _LIBCPP_TEMPLATE_VIS boyer_moore_searcher { -private: - typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type; - typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type; - typedef _BMSkipTable<value_type, difference_type, _Hash, _BinaryPredicate, - is_integral<value_type>::value && // what about enums? - sizeof(value_type) == 1 && - is_same<_Hash, hash<value_type>>::value && - is_same<_BinaryPredicate, equal_to<>>::value - > skip_table_type; - -public: - boyer_moore_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l, - _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate()) - : __first_(__f), __last_(__l), __pred_(__pred), - __pattern_length_(_VSTD::distance(__first_, __last_)), - __skip_{make_shared<skip_table_type>(__pattern_length_, -1, __hf, __pred_)}, - __suffix_{make_shared<vector<difference_type>>(__pattern_length_ + 1)} - { - // build the skip table - for ( difference_type __i = 0; __f != __l; ++__f, (void) ++__i ) - __skip_->insert(*__f, __i); - - this->__build_suffix_table ( __first_, __last_, __pred_ ); - } - - template <typename _RandomAccessIterator2> - pair<_RandomAccessIterator2, _RandomAccessIterator2> - operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const - { - static_assert ( std::is_same< - typename std::__uncvref<typename std::iterator_traits<_RandomAccessIterator1>::value_type>::type, - typename std::__uncvref<typename std::iterator_traits<_RandomAccessIterator2>::value_type>::type - >::value, - "Corpus and Pattern iterators must point to the same type" ); - - if (__f == __l ) return make_pair(__l, __l); // empty corpus - if (__first_ == __last_) return make_pair(__f, __f); // empty pattern - - // If the pattern is larger than the corpus, we can't find it! - if ( __pattern_length_ > _VSTD::distance(__f, __l)) - return make_pair(__l, __l); - - // Do the search - return this->__search(__f, __l); - } - -private: - _RandomAccessIterator1 __first_; - _RandomAccessIterator1 __last_; - _BinaryPredicate __pred_; - difference_type __pattern_length_; - shared_ptr<skip_table_type> __skip_; - shared_ptr<vector<difference_type>> __suffix_; - - template <typename _RandomAccessIterator2> - pair<_RandomAccessIterator2, _RandomAccessIterator2> - __search(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const - { - _RandomAccessIterator2 __cur = __f; - const _RandomAccessIterator2 __last = __l - __pattern_length_; - const skip_table_type & __skip = *__skip_.get(); - const vector<difference_type> & __suffix = *__suffix_.get(); - - while (__cur <= __last) - { - - // Do we match right where we are? - difference_type __j = __pattern_length_; - while (__pred_(__first_ [__j-1], __cur [__j-1])) { - __j--; - // We matched - we're done! - if ( __j == 0 ) - return make_pair(__cur, __cur + __pattern_length_); - } - - // Since we didn't match, figure out how far to skip forward - difference_type __k = __skip[__cur [ __j - 1 ]]; - difference_type __m = __j - __k - 1; - if (__k < __j && __m > __suffix[ __j ]) - __cur += __m; - else - __cur += __suffix[ __j ]; - } - - return make_pair(__l, __l); // We didn't find anything - } - - - template<typename _Iterator, typename _Container> - void __compute_bm_prefix ( _Iterator __f, _Iterator __l, _BinaryPredicate __pred, _Container &__prefix ) - { - const size_t __count = _VSTD::distance(__f, __l); - - __prefix[0] = 0; - size_t __k = 0; - for ( size_t __i = 1; __i < __count; ++__i ) - { - while ( __k > 0 && !__pred ( __f[__k], __f[__i] )) - __k = __prefix [ __k - 1 ]; - - if ( __pred ( __f[__k], __f[__i] )) - __k++; - __prefix [ __i ] = __k; - } - } - - void __build_suffix_table(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l, - _BinaryPredicate __pred) - { - const size_t __count = _VSTD::distance(__f, __l); - vector<difference_type> & __suffix = *__suffix_.get(); - if (__count > 0) - { - vector<value_type> __scratch(__count); - - __compute_bm_prefix(__f, __l, __pred, __scratch); - for ( size_t __i = 0; __i <= __count; __i++ ) - __suffix[__i] = __count - __scratch[__count-1]; - - typedef reverse_iterator<_RandomAccessIterator1> _RevIter; - __compute_bm_prefix(_RevIter(__l), _RevIter(__f), __pred, __scratch); - - for ( size_t __i = 0; __i < __count; __i++ ) - { - const size_t __j = __count - __scratch[__i]; - const difference_type __k = __i - __scratch[__i] + 1; - - if (__suffix[__j] > __k) - __suffix[__j] = __k; - } - } - } - -}; - -template<class _RandomAccessIterator, - class _Hash = hash<typename iterator_traits<_RandomAccessIterator>::value_type>, - class _BinaryPredicate = equal_to<>> -_LIBCPP_INLINE_VISIBILITY -boyer_moore_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate> -make_boyer_moore_searcher( _RandomAccessIterator __f, _RandomAccessIterator __l, - _Hash __hf = _Hash(), _BinaryPredicate __p = _BinaryPredicate ()) -{ - return boyer_moore_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>(__f, __l, __hf, __p); -} - -// boyer-moore-horspool -template <class _RandomAccessIterator1, - class _Hash = hash<typename iterator_traits<_RandomAccessIterator1>::value_type>, - class _BinaryPredicate = equal_to<>> -class _LIBCPP_TEMPLATE_VIS boyer_moore_horspool_searcher { -private: - typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type difference_type; - typedef typename std::iterator_traits<_RandomAccessIterator1>::value_type value_type; - typedef _BMSkipTable<value_type, difference_type, _Hash, _BinaryPredicate, - is_integral<value_type>::value && // what about enums? - sizeof(value_type) == 1 && - is_same<_Hash, hash<value_type>>::value && - is_same<_BinaryPredicate, equal_to<>>::value - > skip_table_type; - -public: - boyer_moore_horspool_searcher(_RandomAccessIterator1 __f, _RandomAccessIterator1 __l, - _Hash __hf = _Hash(), _BinaryPredicate __pred = _BinaryPredicate()) - : __first_(__f), __last_(__l), __pred_(__pred), - __pattern_length_(_VSTD::distance(__first_, __last_)), - __skip_{_VSTD::make_shared<skip_table_type>(__pattern_length_, __pattern_length_, __hf, __pred_)} - { - // build the skip table - if ( __f != __l ) - { - __l = __l - 1; - for ( difference_type __i = 0; __f != __l; ++__f, (void) ++__i ) - __skip_->insert(*__f, __pattern_length_ - 1 - __i); - } - } - - template <typename _RandomAccessIterator2> - pair<_RandomAccessIterator2, _RandomAccessIterator2> - operator ()(_RandomAccessIterator2 __f, _RandomAccessIterator2 __l) const - { - static_assert ( std::is_same< - typename std::__uncvref<typename std::iterator_traits<_RandomAccessIterator1>::value_type>::type, - typename std::__uncvref<typename std::iterator_traits<_RandomAccessIterator2>::value_type>::type - >::value, - "Corpus and Pattern iterators must point to the same type" ); - - if (__f == __l ) return make_pair(__l, __l); // empty corpus - if (__first_ == __last_) return make_pair(__f, __f); // empty pattern - - // If the pattern is larger than the corpus, we can't find it! - if ( __pattern_length_ > _VSTD::distance(__f, __l)) - return make_pair(__l, __l); - - // Do the search - return this->__search(__f, __l); - } - -private: - _RandomAccessIterator1 __first_; - _RandomAccessIterator1 __last_; - _BinaryPredicate __pred_; - difference_type __pattern_length_; - shared_ptr<skip_table_type> __skip_; - - template <typename _RandomAccessIterator2> - pair<_RandomAccessIterator2, _RandomAccessIterator2> - __search ( _RandomAccessIterator2 __f, _RandomAccessIterator2 __l ) const { - _RandomAccessIterator2 __cur = __f; - const _RandomAccessIterator2 __last = __l - __pattern_length_; - const skip_table_type & __skip = *__skip_.get(); - - while (__cur <= __last) - { - // Do we match right where we are? - difference_type __j = __pattern_length_; - while (__pred_(__first_[__j-1], __cur[__j-1])) - { - __j--; - // We matched - we're done! - if ( __j == 0 ) - return make_pair(__cur, __cur + __pattern_length_); - } - __cur += __skip[__cur[__pattern_length_-1]]; - } - - return make_pair(__l, __l); - } -}; - -template<class _RandomAccessIterator, - class _Hash = hash<typename iterator_traits<_RandomAccessIterator>::value_type>, - class _BinaryPredicate = equal_to<>> -_LIBCPP_INLINE_VISIBILITY -boyer_moore_horspool_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate> -make_boyer_moore_horspool_searcher( _RandomAccessIterator __f, _RandomAccessIterator __l, - _Hash __hf = _Hash(), _BinaryPredicate __p = _BinaryPredicate ()) -{ - return boyer_moore_horspool_searcher<_RandomAccessIterator, _Hash, _BinaryPredicate>(__f, __l, __hf, __p); -} - -#endif // _LIBCPP_STD_VER > 11 - -_LIBCPP_END_NAMESPACE_LFTS - -_LIBCPP_POP_MACROS - -#endif /* _LIBCPP_EXPERIMENTAL_FUNCTIONAL */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/iterator b/contrib/libs/cxxsupp/libcxx/include/experimental/iterator deleted file mode 100644 index 137b206354f..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/iterator +++ /dev/null @@ -1,119 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_ITERATOR -#define _LIBCPP_EXPERIMENTAL_ITERATOR - -/* -namespace std { - namespace experimental { - inline namespace fundamentals_v2 { - - template <class DelimT, class charT = char, class traits = char_traits<charT>> - class ostream_joiner { - public: - typedef charT char_type; - typedef traits traits_type; - typedef basic_ostream<charT, traits> ostream_type; - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - ostream_joiner(ostream_type& s, const DelimT& delimiter); - ostream_joiner(ostream_type& s, DelimT&& delimiter); - - template<typename T> - ostream_joiner& operator=(const T& value); - - ostream_joiner& operator*() noexcept; - ostream_joiner& operator++() noexcept; - ostream_joiner& operator++(int) noexcept; - private: - ostream_type* out_stream; // exposition only - DelimT delim; // exposition only - bool first_element; // exposition only - }; - - template <class charT, class traits, class DelimT> - ostream_joiner<decay_t<DelimT>, charT, traits> - make_ostream_joiner(basic_ostream<charT, traits>& os, DelimT&& delimiter); - - } // inline namespace fundamentals_v2 - } // namespace experimental -} // namespace std - -*/ - -#include <__memory/addressof.h> -#include <__utility/forward.h> -#include <__utility/move.h> -#include <experimental/__config> -#include <iterator> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER > 11 - -_LIBCPP_BEGIN_NAMESPACE_LFTS - -template <class _Delim, class _CharT = char, class _Traits = char_traits<_CharT>> -class ostream_joiner { -public: - - typedef _CharT char_type; - typedef _Traits traits_type; - typedef basic_ostream<char_type,traits_type> ostream_type; - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; - - ostream_joiner(ostream_type& __os, _Delim&& __d) - : __output_iter(_VSTD::addressof(__os)), __delim(_VSTD::move(__d)), __first(true) {} - - ostream_joiner(ostream_type& __os, const _Delim& __d) - : __output_iter(_VSTD::addressof(__os)), __delim(__d), __first(true) {} - - - template<typename _Tp> - ostream_joiner& operator=(const _Tp& __v) - { - if (!__first) - *__output_iter << __delim; - __first = false; - *__output_iter << __v; - return *this; - } - - ostream_joiner& operator*() _NOEXCEPT { return *this; } - ostream_joiner& operator++() _NOEXCEPT { return *this; } - ostream_joiner& operator++(int) _NOEXCEPT { return *this; } - -private: - ostream_type* __output_iter; - _Delim __delim; - bool __first; -}; - - -template <class _CharT, class _Traits, class _Delim> -ostream_joiner<typename decay<_Delim>::type, _CharT, _Traits> -make_ostream_joiner(basic_ostream<_CharT, _Traits>& __os, _Delim && __d) -{ return ostream_joiner<typename decay<_Delim>::type, _CharT, _Traits>(__os, _VSTD::forward<_Delim>(__d)); } - -_LIBCPP_END_NAMESPACE_LFTS - -#endif // _LIBCPP_STD_VER > 11 - -#endif // _LIBCPP_EXPERIMENTAL_ITERATOR diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/list b/contrib/libs/cxxsupp/libcxx/include/experimental/list deleted file mode 100644 index d15d816444e..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/list +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_LIST -#define _LIBCPP_EXPERIMENTAL_LIST -/* - experimental/list synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - template <class T> - using list = std::list<T,polymorphic_allocator<T>>; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <experimental/memory_resource> -#include <list> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _ValueT> -using list = _VSTD::list<_ValueT, polymorphic_allocator<_ValueT>>; - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_LIST */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/map b/contrib/libs/cxxsupp/libcxx/include/experimental/map deleted file mode 100644 index 25bc56ccb4d..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/map +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_MAP -#define _LIBCPP_EXPERIMENTAL_MAP -/* - experimental/map synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - template <class Key, class T, class Compare = less<Key>> - using map = std::map<Key, T, Compare, - polymorphic_allocator<pair<const Key,T>>>; - - template <class Key, class T, class Compare = less<Key>> - using multimap = std::multimap<Key, T, Compare, - polymorphic_allocator<pair<const Key,T>>>; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <experimental/memory_resource> -#include <map> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _Key, class _Value, class _Compare = less<_Key>> -using map = _VSTD::map<_Key, _Value, _Compare, - polymorphic_allocator<pair<const _Key, _Value>>>; - -template <class _Key, class _Value, class _Compare = less<_Key>> -using multimap = _VSTD::multimap<_Key, _Value, _Compare, - polymorphic_allocator<pair<const _Key, _Value>>>; - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_MAP */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource b/contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource deleted file mode 100644 index da3e1033eb1..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/memory_resource +++ /dev/null @@ -1,419 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE -#define _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE - -/** - experimental/memory_resource synopsis - -// C++1y - -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - class memory_resource; - - bool operator==(const memory_resource& a, - const memory_resource& b) noexcept; - bool operator!=(const memory_resource& a, - const memory_resource& b) noexcept; - - template <class Tp> class polymorphic_allocator; - - template <class T1, class T2> - bool operator==(const polymorphic_allocator<T1>& a, - const polymorphic_allocator<T2>& b) noexcept; - template <class T1, class T2> - bool operator!=(const polymorphic_allocator<T1>& a, - const polymorphic_allocator<T2>& b) noexcept; - - // The name resource_adaptor_imp is for exposition only. - template <class Allocator> class resource_adaptor_imp; - - template <class Allocator> - using resource_adaptor = resource_adaptor_imp< - allocator_traits<Allocator>::rebind_alloc<char>>; - - // Global memory resources - memory_resource* new_delete_resource() noexcept; - memory_resource* null_memory_resource() noexcept; - - // The default memory resource - memory_resource* set_default_resource(memory_resource* r) noexcept; - memory_resource* get_default_resource() noexcept; - - // Standard memory resources - struct pool_options; - class synchronized_pool_resource; - class unsynchronized_pool_resource; - class monotonic_buffer_resource; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <__debug> -#include <__tuple> -#include <cstddef> -#include <cstdlib> -#include <experimental/__config> -#include <experimental/__memory> -#include <limits> -#include <memory> -#include <new> -#include <stdexcept> -#include <type_traits> -#include <utility> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -// Round __s up to next multiple of __a. -inline _LIBCPP_INLINE_VISIBILITY -size_t __aligned_allocation_size(size_t __s, size_t __a) _NOEXCEPT -{ - _LIBCPP_ASSERT(__s + __a > __s, "aligned allocation size overflows"); - return (__s + __a - 1) & ~(__a - 1); -} - -// 8.5, memory.resource -class _LIBCPP_TYPE_VIS memory_resource -{ - static const size_t __max_align = _LIBCPP_ALIGNOF(max_align_t); - -// 8.5.2, memory.resource.public -public: - virtual ~memory_resource() = default; - - _LIBCPP_INLINE_VISIBILITY - void* allocate(size_t __bytes, size_t __align = __max_align) - { return do_allocate(__bytes, __align); } - - _LIBCPP_INLINE_VISIBILITY - void deallocate(void * __p, size_t __bytes, size_t __align = __max_align) - { do_deallocate(__p, __bytes, __align); } - - _LIBCPP_INLINE_VISIBILITY - bool is_equal(memory_resource const & __other) const _NOEXCEPT - { return do_is_equal(__other); } - -// 8.5.3, memory.resource.priv -private: - virtual void* do_allocate(size_t, size_t) = 0; - virtual void do_deallocate(void*, size_t, size_t) = 0; - virtual bool do_is_equal(memory_resource const &) const _NOEXCEPT = 0; -}; - -// 8.5.4, memory.resource.eq -inline _LIBCPP_INLINE_VISIBILITY -bool operator==(memory_resource const & __lhs, - memory_resource const & __rhs) _NOEXCEPT -{ - return &__lhs == &__rhs || __lhs.is_equal(__rhs); -} - -inline _LIBCPP_INLINE_VISIBILITY -bool operator!=(memory_resource const & __lhs, - memory_resource const & __rhs) _NOEXCEPT -{ - return !(__lhs == __rhs); -} - -_LIBCPP_FUNC_VIS -memory_resource * new_delete_resource() _NOEXCEPT; - -_LIBCPP_FUNC_VIS -memory_resource * null_memory_resource() _NOEXCEPT; - -_LIBCPP_FUNC_VIS -memory_resource * get_default_resource() _NOEXCEPT; - -_LIBCPP_FUNC_VIS -memory_resource * set_default_resource(memory_resource * __new_res) _NOEXCEPT; - -// 8.6, memory.polymorphic.allocator.class - -// 8.6.1, memory.polymorphic.allocator.overview -template <class _ValueType> -class _LIBCPP_TEMPLATE_VIS polymorphic_allocator -{ -public: - typedef _ValueType value_type; - - // 8.6.2, memory.polymorphic.allocator.ctor - _LIBCPP_INLINE_VISIBILITY - polymorphic_allocator() _NOEXCEPT - : __res_(_VSTD_LFTS_PMR::get_default_resource()) - {} - - _LIBCPP_INLINE_VISIBILITY - polymorphic_allocator(memory_resource * __r) _NOEXCEPT - : __res_(__r) - {} - - polymorphic_allocator(polymorphic_allocator const &) = default; - - template <class _Tp> - _LIBCPP_INLINE_VISIBILITY - polymorphic_allocator(polymorphic_allocator<_Tp> const & __other) _NOEXCEPT - : __res_(__other.resource()) - {} - - polymorphic_allocator & - operator=(polymorphic_allocator const &) = delete; - - // 8.6.3, memory.polymorphic.allocator.mem - _LIBCPP_INLINE_VISIBILITY - _ValueType* allocate(size_t __n) { - if (__n > __max_size()) - __throw_bad_array_new_length(); - return static_cast<_ValueType*>( - __res_->allocate(__n * sizeof(_ValueType), _LIBCPP_ALIGNOF(_ValueType)) - ); - } - - _LIBCPP_INLINE_VISIBILITY - void deallocate(_ValueType * __p, size_t __n) _NOEXCEPT { - _LIBCPP_ASSERT(__n <= __max_size(), - "deallocate called for size which exceeds max_size()"); - __res_->deallocate(__p, __n * sizeof(_ValueType), _LIBCPP_ALIGNOF(_ValueType)); - } - - template <class _Tp, class ..._Ts> - _LIBCPP_INLINE_VISIBILITY - void construct(_Tp* __p, _Ts &&... __args) - { - _VSTD_LFTS::__lfts_user_alloc_construct( - __p, *this, _VSTD::forward<_Ts>(__args)... - ); - } - - template <class _T1, class _T2, class ..._Args1, class ..._Args2> - _LIBCPP_INLINE_VISIBILITY - void construct(pair<_T1, _T2>* __p, piecewise_construct_t, - tuple<_Args1...> __x, tuple<_Args2...> __y) - { - ::new ((void*)__p) pair<_T1, _T2>(piecewise_construct - , __transform_tuple( - typename __lfts_uses_alloc_ctor< - _T1, polymorphic_allocator&, _Args1... - >::type() - , _VSTD::move(__x) - , typename __make_tuple_indices<sizeof...(_Args1)>::type{} - ) - , __transform_tuple( - typename __lfts_uses_alloc_ctor< - _T2, polymorphic_allocator&, _Args2... - >::type() - , _VSTD::move(__y) - , typename __make_tuple_indices<sizeof...(_Args2)>::type{} - ) - ); - } - - template <class _T1, class _T2> - _LIBCPP_INLINE_VISIBILITY - void construct(pair<_T1, _T2>* __p) { - construct(__p, piecewise_construct, tuple<>(), tuple<>()); - } - - template <class _T1, class _T2, class _Up, class _Vp> - _LIBCPP_INLINE_VISIBILITY - void construct(pair<_T1, _T2> * __p, _Up && __u, _Vp && __v) { - construct(__p, piecewise_construct - , _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__u)) - , _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__v))); - } - - template <class _T1, class _T2, class _U1, class _U2> - _LIBCPP_INLINE_VISIBILITY - void construct(pair<_T1, _T2> * __p, pair<_U1, _U2> const & __pr) { - construct(__p, piecewise_construct - , _VSTD::forward_as_tuple(__pr.first) - , _VSTD::forward_as_tuple(__pr.second)); - } - - template <class _T1, class _T2, class _U1, class _U2> - _LIBCPP_INLINE_VISIBILITY - void construct(pair<_T1, _T2> * __p, pair<_U1, _U2> && __pr){ - construct(__p, piecewise_construct - , _VSTD::forward_as_tuple(_VSTD::forward<_U1>(__pr.first)) - , _VSTD::forward_as_tuple(_VSTD::forward<_U2>(__pr.second))); - } - - template <class _Tp> - _LIBCPP_INLINE_VISIBILITY - void destroy(_Tp * __p) _NOEXCEPT - { __p->~_Tp(); } - - _LIBCPP_INLINE_VISIBILITY - polymorphic_allocator - select_on_container_copy_construction() const _NOEXCEPT - { return polymorphic_allocator(); } - - _LIBCPP_INLINE_VISIBILITY - memory_resource * resource() const _NOEXCEPT - { return __res_; } - -private: - template <class ..._Args, size_t ..._Idx> - _LIBCPP_INLINE_VISIBILITY - tuple<_Args&&...> - __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t, - __tuple_indices<_Idx...>) const - { - return _VSTD::forward_as_tuple(_VSTD::get<_Idx>(_VSTD::move(__t))...); - } - - template <class ..._Args, size_t ..._Idx> - _LIBCPP_INLINE_VISIBILITY - tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...> - __transform_tuple(integral_constant<int, 1>, tuple<_Args...> && __t, - __tuple_indices<_Idx...>) - { - using _Tup = tuple<allocator_arg_t const&, polymorphic_allocator&, _Args&&...>; - return _Tup(allocator_arg, *this, - _VSTD::get<_Idx>(_VSTD::move(__t))...); - } - - template <class ..._Args, size_t ..._Idx> - _LIBCPP_INLINE_VISIBILITY - tuple<_Args&&..., polymorphic_allocator&> - __transform_tuple(integral_constant<int, 2>, tuple<_Args...> && __t, - __tuple_indices<_Idx...>) - { - using _Tup = tuple<_Args&&..., polymorphic_allocator&>; - return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., *this); - } - - _LIBCPP_INLINE_VISIBILITY - size_t __max_size() const _NOEXCEPT - { return numeric_limits<size_t>::max() / sizeof(value_type); } - - memory_resource * __res_; -}; - -// 8.6.4, memory.polymorphic.allocator.eq - -template <class _Tp, class _Up> -inline _LIBCPP_INLINE_VISIBILITY -bool operator==(polymorphic_allocator<_Tp> const & __lhs, - polymorphic_allocator<_Up> const & __rhs) _NOEXCEPT -{ - return *__lhs.resource() == *__rhs.resource(); -} - -template <class _Tp, class _Up> -inline _LIBCPP_INLINE_VISIBILITY -bool operator!=(polymorphic_allocator<_Tp> const & __lhs, - polymorphic_allocator<_Up> const & __rhs) _NOEXCEPT -{ - return !(__lhs == __rhs); -} - -// 8.7, memory.resource.adaptor - -// 8.7.1, memory.resource.adaptor.overview -template <class _CharAlloc> -class _LIBCPP_TEMPLATE_VIS __resource_adaptor_imp - : public memory_resource -{ - using _CTraits = allocator_traits<_CharAlloc>; - static_assert(is_same<typename _CTraits::value_type, char>::value - && is_same<typename _CTraits::pointer, char*>::value - && is_same<typename _CTraits::void_pointer, void*>::value, ""); - - static const size_t _MaxAlign = _LIBCPP_ALIGNOF(max_align_t); - - using _Alloc = typename _CTraits::template rebind_alloc< - typename aligned_storage<_MaxAlign, _MaxAlign>::type - >; - - using _ValueType = typename _Alloc::value_type; - - _Alloc __alloc_; - -public: - typedef _CharAlloc allocator_type; - - __resource_adaptor_imp() = default; - __resource_adaptor_imp(__resource_adaptor_imp const &) = default; - __resource_adaptor_imp(__resource_adaptor_imp &&) = default; - - // 8.7.2, memory.resource.adaptor.ctor - - _LIBCPP_INLINE_VISIBILITY - explicit __resource_adaptor_imp(allocator_type const & __a) - : __alloc_(__a) - {} - - _LIBCPP_INLINE_VISIBILITY - explicit __resource_adaptor_imp(allocator_type && __a) - : __alloc_(_VSTD::move(__a)) - {} - - __resource_adaptor_imp & - operator=(__resource_adaptor_imp const &) = default; - - _LIBCPP_INLINE_VISIBILITY - allocator_type get_allocator() const - { return __alloc_; } - -// 8.7.3, memory.resource.adaptor.mem -private: - virtual void * do_allocate(size_t __bytes, size_t) - { - if (__bytes > __max_size()) - __throw_bad_array_new_length(); - size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign; - return __alloc_.allocate(__s); - } - - virtual void do_deallocate(void * __p, size_t __bytes, size_t) - { - _LIBCPP_ASSERT(__bytes <= __max_size(), - "do_deallocate called for size which exceeds the maximum allocation size"); - size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign; - __alloc_.deallocate((_ValueType*)__p, __s); - } - - virtual bool do_is_equal(memory_resource const & __other) const _NOEXCEPT { - __resource_adaptor_imp const * __p - = dynamic_cast<__resource_adaptor_imp const *>(&__other); - return __p ? __alloc_ == __p->__alloc_ : false; - } - - _LIBCPP_INLINE_VISIBILITY - size_t __max_size() const _NOEXCEPT { - return numeric_limits<size_t>::max() - _MaxAlign; - } -}; - -template <class _Alloc> -using resource_adaptor = __resource_adaptor_imp< - typename allocator_traits<_Alloc>::template rebind_alloc<char> - >; - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -_LIBCPP_POP_MACROS - -#endif /* _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/propagate_const b/contrib/libs/cxxsupp/libcxx/include/experimental/propagate_const deleted file mode 100644 index c2774b19d3b..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/propagate_const +++ /dev/null @@ -1,576 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST -#define _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST -/* - propagate_const synopsis - - namespace std { namespace experimental { inline namespace fundamentals_v2 { - - // [propagate_const] - template <class T> class propagate_const; - - // [propagate_const.underlying], underlying pointer access - constexpr const _Tp& _VSTD_LFTS_V2::get_underlying(const propagate_const<T>& pt) noexcept; - constexpr T& _VSTD_LFTS_V2::get_underlying(propagate_const<T>& pt) noexcept; - - // [propagate_const.relational], relational operators - template <class T> constexpr bool operator==(const propagate_const<T>& pt, nullptr_t); - template <class T> constexpr bool operator==(nullptr_t, const propagate_const<T>& pu); - template <class T> constexpr bool operator!=(const propagate_const<T>& pt, nullptr_t); - template <class T> constexpr bool operator!=(nullptr_t, const propagate_const<T>& pu); - template <class T, class U> constexpr bool operator==(const propagate_const<T>& pt, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator!=(const propagate_const<T>& pt, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator<(const propagate_const<T>& pt, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator>(const propagate_const<T>& pt, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator<=(const propagate_const<T>& pt, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator>=(const propagate_const<T>& pt, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator==(const propagate_const<T>& pt, const _Up& u); - template <class T, class U> constexpr bool operator!=(const propagate_const<T>& pt, const _Up& u); - template <class T, class U> constexpr bool operator<(const propagate_const<T>& pt, const _Up& u); - template <class T, class U> constexpr bool operator>(const propagate_const<T>& pt, const _Up& u); - template <class T, class U> constexpr bool operator<=(const propagate_const<T>& pt, const _Up& u); - template <class T, class U> constexpr bool operator>=(const propagate_const<T>& pt, const _Up& u); - template <class T, class U> constexpr bool operator==(const _Tp& t, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator!=(const _Tp& t, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator<(const _Tp& t, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator>(const _Tp& t, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator<=(const _Tp& t, const propagate_const<_Up>& pu); - template <class T, class U> constexpr bool operator>=(const _Tp& t, const propagate_const<_Up>& pu); - - // [propagate_const.algorithms], specialized algorithms - template <class T> constexpr void swap(propagate_const<T>& pt, propagate_const<T>& pu) noexcept(see below); - - template <class T> - class propagate_const - { - - public: - typedef remove_reference_t<decltype(*declval<T&>())> element_type; - - // [propagate_const.ctor], constructors - constexpr propagate_const() = default; - propagate_const(const propagate_const& p) = delete; - constexpr propagate_const(propagate_const&& p) = default; - template <class U> EXPLICIT constexpr propagate_const(propagate_const<_Up>&& pu); // see below - template <class U> EXPLICIT constexpr propagate_const(U&& u); // see below - - // [propagate_const.assignment], assignment - propagate_const& operator=(const propagate_const& p) = delete; - constexpr propagate_const& operator=(propagate_const&& p) = default; - template <class U> constexpr propagate_const& operator=(propagate_const<_Up>&& pu); - template <class U> constexpr propagate_const& operator=(U&& u); // see below - - // [propagate_const.const_observers], const observers - explicit constexpr operator bool() const; - constexpr const element_type* operator->() const; - constexpr operator const element_type*() const; // Not always defined - constexpr const element_type& operator*() const; - constexpr const element_type* get() const; - - // [propagate_const.non_const_observers], non-const observers - constexpr element_type* operator->(); - constexpr operator element_type*(); // Not always defined - constexpr element_type& operator*(); - constexpr element_type* get(); - - // [propagate_const.modifiers], modifiers - constexpr void swap(propagate_const& pt) noexcept(see below) - - private: - T t_; // exposition only - }; - - } // namespace fundamentals_v2 - } // namespace experimental - - // [propagate_const.hash], hash support - template <class T> struct hash<experimental::fundamentals_v2::propagate_const<T>>; - - // [propagate_const.comparison_function_objects], comparison function objects - template <class T> struct equal_to<experimental::fundamentals_v2::propagate_const<T>>; - template <class T> struct not_equal_to<experimental::fundamentals_v2::propagate_const<T>>; - template <class T> struct less<experimental::fundamentals_v2::propagate_const<T>>; - template <class T> struct greater<experimental::fundamentals_v2::propagate_const<T>>; - template <class T> struct less_equal<experimental::fundamentals_v2::propagate_const<T>>; - template <class T> struct greater_equal<experimental::fundamentals_v2::propagate_const<T>>; - -} // namespace std - -*/ - -#include <experimental/__config> -#include <functional> -#include <type_traits> -#include <utility> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER > 11 - -_LIBCPP_BEGIN_NAMESPACE_LFTS_V2 - -template <class _Tp> -class propagate_const; - -template <class _Up> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -const _Up& get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT; - -template <class _Up> -inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR -_Up& get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT; - -template <class _Tp> -class propagate_const -{ -public: - typedef remove_reference_t<decltype(*declval<_Tp&>())> element_type; - - static_assert(!is_array<_Tp>::value, - "Instantiation of propagate_const with an array type is ill-formed."); - static_assert(!is_reference<_Tp>::value, - "Instantiation of propagate_const with a reference type is ill-formed."); - static_assert(!(is_pointer<_Tp>::value && is_function<typename remove_pointer<_Tp>::type>::value), - "Instantiation of propagate_const with a function-pointer type is ill-formed."); - static_assert(!(is_pointer<_Tp>::value && is_same<typename remove_cv<typename remove_pointer<_Tp>::type>::type, void>::value), - "Instantiation of propagate_const with a pointer to (possibly cv-qualified) void is ill-formed."); - -private: - template <class _Up> - static _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up* __u) - { - return __u; - } - - template <class _Up> - static _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up& __u) - { - return __get_pointer(__u.get()); - } - - template <class _Up> - static _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up* __u) - { - return __u; - } - - template <class _Up> - static _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up& __u) - { - return __get_pointer(__u.get()); - } - - template <class _Up> - struct __is_propagate_const : false_type - { - }; - - template <class _Up> - struct __is_propagate_const<propagate_const<_Up>> : true_type - { - }; - - _Tp __t_; - -public: - - template <class _Up> friend _LIBCPP_CONSTEXPR const _Up& ::_VSTD_LFTS_V2::get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT; - template <class _Up> friend _LIBCPP_CONSTEXPR _Up& ::_VSTD_LFTS_V2::get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT; - - _LIBCPP_CONSTEXPR propagate_const() = default; - - propagate_const(const propagate_const&) = delete; - - _LIBCPP_CONSTEXPR propagate_const(propagate_const&&) = default; - - template <class _Up, enable_if_t<!is_convertible<_Up, _Tp>::value && - is_constructible<_Tp, _Up&&>::value,bool> = true> - explicit _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu) - : __t_(std::move(_VSTD_LFTS_V2::get_underlying(__pu))) - { - } - - template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value && - is_constructible<_Tp, _Up&&>::value,bool> = false> - _LIBCPP_CONSTEXPR propagate_const(propagate_const<_Up>&& __pu) - : __t_(std::move(_VSTD_LFTS_V2::get_underlying(__pu))) - { - } - - template <class _Up, enable_if_t<!is_convertible<_Up&&, _Tp>::value && - is_constructible<_Tp, _Up&&>::value && - !__is_propagate_const<decay_t<_Up>>::value,bool> = true> - explicit _LIBCPP_CONSTEXPR propagate_const(_Up&& __u) - : __t_(std::forward<_Up>(__u)) - { - } - - template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value && - is_constructible<_Tp, _Up&&>::value && - !__is_propagate_const<decay_t<_Up>>::value,bool> = false> - _LIBCPP_CONSTEXPR propagate_const(_Up&& __u) - : __t_(std::forward<_Up>(__u)) - { - } - - propagate_const& operator=(const propagate_const&) = delete; - - _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const&&) = default; - - template <class _Up> - _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const<_Up>&& __pu) - { - __t_ = std::move(_VSTD_LFTS_V2::get_underlying(__pu)); - return *this; - } - - template <class _Up, class _Vp = enable_if_t<!__is_propagate_const<decay_t<_Up>>::value>> - _LIBCPP_CONSTEXPR propagate_const& operator=(_Up&& __u) - { - __t_ = std::forward<_Up>(__u); - return *this; - } - - _LIBCPP_CONSTEXPR const element_type* get() const - { - return __get_pointer(__t_); - } - - _LIBCPP_CONSTEXPR element_type* get() - { - return __get_pointer(__t_); - } - - explicit _LIBCPP_CONSTEXPR operator bool() const - { - return get() != nullptr; - } - - _LIBCPP_CONSTEXPR const element_type* operator->() const - { - return get(); - } - - template <class _Tp_ = _Tp, class _Up = enable_if_t<is_convertible< - const _Tp_, const element_type *>::value>> - _LIBCPP_CONSTEXPR operator const element_type *() const { - return get(); - } - - _LIBCPP_CONSTEXPR const element_type& operator*() const - { - return *get(); - } - - _LIBCPP_CONSTEXPR element_type* operator->() - { - return get(); - } - - template <class _Tp_ = _Tp, class _Up = enable_if_t< - is_convertible<_Tp_, element_type *>::value>> - _LIBCPP_CONSTEXPR operator element_type *() { - return get(); - } - - _LIBCPP_CONSTEXPR element_type& operator*() - { - return *get(); - } - - _LIBCPP_CONSTEXPR void swap(propagate_const& __pt) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) - { - using _VSTD::swap; - swap(__t_, __pt.__t_); - } -}; - - -template <class _Tp> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, nullptr_t) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) == nullptr; -} - -template <class _Tp> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator==(nullptr_t, const propagate_const<_Tp>& __pt) -{ - return nullptr == _VSTD_LFTS_V2::get_underlying(__pt); -} - -template <class _Tp> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, nullptr_t) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) != nullptr; -} - -template <class _Tp> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator!=(nullptr_t, const propagate_const<_Tp>& __pt) -{ - return nullptr != _VSTD_LFTS_V2::get_underlying(__pt); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, - const propagate_const<_Up>& __pu) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) == _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, - const propagate_const<_Up>& __pu) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) != _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt, - const propagate_const<_Up>& __pu) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) < _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt, - const propagate_const<_Up>& __pu) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) > _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt, - const propagate_const<_Up>& __pu) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) <= _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt, - const propagate_const<_Up>& __pu) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) >= _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator==(const propagate_const<_Tp>& __pt, const _Up& __u) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) == __u; -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator!=(const propagate_const<_Tp>& __pt, const _Up& __u) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) != __u; -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator<(const propagate_const<_Tp>& __pt, const _Up& __u) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) < __u; -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator>(const propagate_const<_Tp>& __pt, const _Up& __u) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) > __u; -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator<=(const propagate_const<_Tp>& __pt, const _Up& __u) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) <= __u; -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator>=(const propagate_const<_Tp>& __pt, const _Up& __u) -{ - return _VSTD_LFTS_V2::get_underlying(__pt) >= __u; -} - - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator==(const _Tp& __t, const propagate_const<_Up>& __pu) -{ - return __t == _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator!=(const _Tp& __t, const propagate_const<_Up>& __pu) -{ - return __t != _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator<(const _Tp& __t, const propagate_const<_Up>& __pu) -{ - return __t < _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator>(const _Tp& __t, const propagate_const<_Up>& __pu) -{ - return __t > _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator<=(const _Tp& __t, const propagate_const<_Up>& __pu) -{ - return __t <= _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp, class _Up> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR bool operator>=(const _Tp& __t, const propagate_const<_Up>& __pu) -{ - return __t >= _VSTD_LFTS_V2::get_underlying(__pu); -} - -template <class _Tp> -_LIBCPP_INLINE_VISIBILITY -_LIBCPP_CONSTEXPR void swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& __pc2) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) -{ - __pc1.swap(__pc2); -} - -template <class _Tp> -_LIBCPP_CONSTEXPR const _Tp& get_underlying(const propagate_const<_Tp>& __pt) _NOEXCEPT -{ - return __pt.__t_; -} - -template <class _Tp> -_LIBCPP_CONSTEXPR _Tp& get_underlying(propagate_const<_Tp>& __pt) _NOEXCEPT -{ - return __pt.__t_; -} - -_LIBCPP_END_NAMESPACE_LFTS_V2 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Tp> -struct hash<experimental::fundamentals_v2::propagate_const<_Tp>> -{ - typedef size_t result_type; - typedef experimental::fundamentals_v2::propagate_const<_Tp> argument_type; - - size_t operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1) const - { - return std::hash<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1)); - } -}; - -template <class _Tp> -struct equal_to<experimental::fundamentals_v2::propagate_const<_Tp>> -{ - typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; - typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, - const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const - { - return std::equal_to<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); - } -}; - -template <class _Tp> -struct not_equal_to<experimental::fundamentals_v2::propagate_const<_Tp>> -{ - typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; - typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, - const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const - { - return std::not_equal_to<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); - } -}; - -template <class _Tp> -struct less<experimental::fundamentals_v2::propagate_const<_Tp>> -{ - typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; - typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, - const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const - { - return std::less<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); - } -}; - -template <class _Tp> -struct greater<experimental::fundamentals_v2::propagate_const<_Tp>> -{ - typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; - typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, - const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const - { - return std::greater<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); - } -}; - -template <class _Tp> -struct less_equal<experimental::fundamentals_v2::propagate_const<_Tp>> -{ - typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; - typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, - const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const - { - return std::less_equal<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); - } -}; - -template <class _Tp> -struct greater_equal<experimental::fundamentals_v2::propagate_const<_Tp>> -{ - typedef experimental::fundamentals_v2::propagate_const<_Tp> first_argument_type; - typedef experimental::fundamentals_v2::propagate_const<_Tp> second_argument_type; - - bool operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1, - const experimental::fundamentals_v2::propagate_const<_Tp>& __pc2) const - { - return std::greater_equal<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1), _VSTD_LFTS_V2::get_underlying(__pc2)); - } -}; - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_STD_VER > 11 -#endif // _LIBCPP_EXPERIMENTAL_PROPAGATE_CONST diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/regex b/contrib/libs/cxxsupp/libcxx/include/experimental/regex deleted file mode 100644 index f108d2e8d0c..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/regex +++ /dev/null @@ -1,63 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_REGEX -#define _LIBCPP_EXPERIMENTAL_REGEX -/* - experimental/regex synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - template <class BidirectionalIterator> - using match_results = - std::match_results<BidirectionalIterator, - polymorphic_allocator<sub_match<BidirectionalIterator>>>; - - typedef match_results<const char*> cmatch; - typedef match_results<const wchar_t*> wcmatch; - typedef match_results<string::const_iterator> smatch; - typedef match_results<wstring::const_iterator> wsmatch; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <experimental/memory_resource> -#include <experimental/string> -#include <regex> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _BiDirIter> -using match_results = - _VSTD::match_results<_BiDirIter, - polymorphic_allocator<_VSTD::sub_match<_BiDirIter>>>; - -typedef match_results<const char*> cmatch; -typedef match_results<_VSTD_LFTS_PMR::string::const_iterator> smatch; -#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -typedef match_results<const wchar_t*> wcmatch; -typedef match_results<_VSTD_LFTS_PMR::wstring::const_iterator> wsmatch; -#endif - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_REGEX */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/set b/contrib/libs/cxxsupp/libcxx/include/experimental/set deleted file mode 100644 index 208952cb44d..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/set +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_SET -#define _LIBCPP_EXPERIMENTAL_SET -/* - experimental/set synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - template <class Key, class T, class Compare = less<Key>> - using set = std::set<Key, T, Compare, - polymorphic_allocator<pair<const Key,T>>>; - - template <class Key, class T, class Compare = less<Key>> - using multiset = std::multiset<Key, T, Compare, - polymorphic_allocator<pair<const Key,T>>>; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <experimental/memory_resource> -#include <set> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _Value, class _Compare = less<_Value>> -using set = _VSTD::set<_Value, _Compare, - polymorphic_allocator<_Value>>; - -template <class _Value, class _Compare = less<_Value>> -using multiset = _VSTD::multiset<_Value, _Compare, - polymorphic_allocator<_Value>>; - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_SET */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/simd b/contrib/libs/cxxsupp/libcxx/include/experimental/simd deleted file mode 100644 index 6e8bfab4c35..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/simd +++ /dev/null @@ -1,1572 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#ifndef _LIBCPP_EXPERIMENTAL_SIMD -#define _LIBCPP_EXPERIMENTAL_SIMD - -/* - experimental/simd synopsis - -namespace std::experimental { - -inline namespace parallelism_v2 { - -namespace simd_abi { - -struct scalar {}; -template <int N> struct fixed_size {}; -template <typename T> inline constexpr int max_fixed_size = implementation-defined; -template <typename T> using compatible = implementation-defined; -template <typename T> using native = implementation-defined; - -} // simd_abi - -struct element_aligned_tag {}; -struct vector_aligned_tag {}; -template <size_t> struct overaligned_tag {}; -inline constexpr element_aligned_tag element_aligned{}; -inline constexpr vector_aligned_tag vector_aligned{}; -template <size_t N> inline constexpr overaligned_tag<N> overaligned{}; - -// traits [simd.traits] -template <class T> struct is_abi_tag; -template <class T> inline constexpr bool is_abi_tag_v = is_abi_tag<T>::value; - -template <class T> struct is_simd; -template <class T> inline constexpr bool is_simd_v = is_simd<T>::value; - -template <class T> struct is_simd_mask; -template <class T> inline constexpr bool is_simd_mask_v = is_simd_mask<T>::value; - -template <class T> struct is_simd_flag_type; -template <class T> inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value; - -template <class T, size_t N> struct abi_for_size { using type = see below; }; -template <class T, size_t N> using abi_for_size_t = typename abi_for_size<T, N>::type; - -template <class T, class Abi = simd_abi::compatible<T>> struct simd_size; -template <class T, class Abi = simd_abi::compatible<T>> -inline constexpr size_t simd_size_v = simd_size<T, Abi>::value; - -template <class T, class U = typename T::value_type> struct memory_alignment; -template <class T, class U = typename T::value_type> -inline constexpr size_t memory_alignment_v = memory_alignment<T, U>::value; - -// class template simd [simd.class] -template <class T, class Abi = simd_abi::compatible<T>> class simd; -template <class T> using native_simd = simd<T, simd_abi::native<T>>; -template <class T, int N> using fixed_size_simd = simd<T, simd_abi::fixed_size<N>>; - -// class template simd_mask [simd.mask.class] -template <class T, class Abi = simd_abi::compatible<T>> class simd_mask; -template <class T> using native_simd_mask = simd_mask<T, simd_abi::native<T>>; -template <class T, int N> using fixed_size_simd_mask = simd_mask<T, simd_abi::fixed_size<N>>; - -// casts [simd.casts] -template <class T, class U, class Abi> see below simd_cast(const simd<U, Abi>&); -template <class T, class U, class Abi> see below static_simd_cast(const simd<U, Abi>&); - -template <class T, class Abi> -fixed_size_simd<T, simd_size_v<T, Abi>> to_fixed_size(const simd<T, Abi>&) noexcept; -template <class T, class Abi> -fixed_size_simd_mask<T, simd_size_v<T, Abi>> to_fixed_size(const simd_mask<T, Abi>&) noexcept; -template <class T, size_t N> native_simd<T> to_native(const fixed_size_simd<T, N>&) noexcept; -template <class T, size_t N> -native_simd_mask<T> to_native(const fixed_size_simd_mask<T, N>> &) noexcept; -template <class T, size_t N> simd<T> to_compatible(const fixed_size_simd<T, N>&) noexcept; -template <class T, size_t N> simd_mask<T> to_compatible(const fixed_size_simd_mask<T, N>&) noexcept; - -template <size_t... Sizes, class T, class Abi> -tuple<simd<T, abi_for_size_t<Sizes>>...> split(const simd<T, Abi>&); -template <size_t... Sizes, class T, class Abi> -tuple<simd_mask<T, abi_for_size_t<Sizes>>...> split(const simd_mask<T, Abi>&); -template <class V, class Abi> -array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( -const simd<typename V::value_type, Abi>&); -template <class V, class Abi> -array<V, simd_size_v<typename V::value_type, Abi> / V::size()> split( -const simd_mask<typename V::value_type, Abi>&); - -template <class T, class... Abis> -simd<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd<T, Abis>&...); -template <class T, class... Abis> -simd_mask<T, abi_for_size_t<T, (simd_size_v<T, Abis> + ...)>> concat(const simd_mask<T, Abis>&...); - -// reductions [simd.mask.reductions] -template <class T, class Abi> bool all_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> bool any_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> bool none_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> bool some_of(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> int popcount(const simd_mask<T, Abi>&) noexcept; -template <class T, class Abi> int find_first_set(const simd_mask<T, Abi>&); -template <class T, class Abi> int find_last_set(const simd_mask<T, Abi>&); - -bool all_of(see below) noexcept; -bool any_of(see below) noexcept; -bool none_of(see below) noexcept; -bool some_of(see below) noexcept; -int popcount(see below) noexcept; -int find_first_set(see below) noexcept; -int find_last_set(see below) noexcept; - -// masked assignment [simd.whereexpr] -template <class M, class T> class const_where_expression; -template <class M, class T> class where_expression; - -// masked assignment [simd.mask.where] -template <class T> struct nodeduce { using type = T; }; // exposition only - -template <class T> using nodeduce_t = typename nodeduce<T>::type; // exposition only - -template <class T, class Abi> -where_expression<simd_mask<T, Abi>, simd<T, Abi>> -where(const typename simd<T, Abi>::mask_type&, simd<T, Abi>&) noexcept; - -template <class T, class Abi> -const_where_expression<simd_mask<T, Abi>, const simd<T, Abi>> -where(const typename simd<T, Abi>::mask_type&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> -where_expression<simd_mask<T, Abi>, simd_mask<T, Abi>> -where(const nodeduce_t<simd_mask<T, Abi>>&, simd_mask<T, Abi>&) noexcept; - -template <class T, class Abi> -const_where_expression<simd_mask<T, Abi>, const simd_mask<T, Abi>> -where(const nodeduce_t<simd_mask<T, Abi>>&, const simd_mask<T, Abi>&) noexcept; - -template <class T> where_expression<bool, T> where(see below k, T& d) noexcept; - -template <class T> -const_where_expression<bool, const T> where(see below k, const T& d) noexcept; - -// reductions [simd.reductions] -template <class T, class Abi, class BinaryOperation = std::plus<>> -T reduce(const simd<T, Abi>&, BinaryOperation = BinaryOperation()); - -template <class M, class V, class BinaryOperation> -typename V::value_type reduce(const const_where_expression<M, V>& x, -typename V::value_type neutral_element, BinaryOperation binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, plus<> binary_op = plus<>()); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, multiplies<> binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, bit_and<> binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, bit_or<> binary_op); - -template <class M, class V> -typename V::value_type reduce(const const_where_expression<M, V>& x, bit_xor<> binary_op); - -template <class T, class Abi> T hmin(const simd<T, Abi>&); -template <class M, class V> T hmin(const const_where_expression<M, V>&); -template <class T, class Abi> T hmax(const simd<T, Abi>&); -template <class M, class V> T hmax(const const_where_expression<M, V>&); - -// algorithms [simd.alg] -template <class T, class Abi> simd<T, Abi> min(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> simd<T, Abi> max(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> -std::pair<simd<T, Abi>, simd<T, Abi>> minmax(const simd<T, Abi>&, const simd<T, Abi>&) noexcept; - -template <class T, class Abi> -simd<T, Abi> clamp(const simd<T, Abi>& v, const simd<T, Abi>& lo, const simd<T, Abi>& hi); - -// [simd.whereexpr] -template <class M, class T> -class const_where_expression { - const M& mask; // exposition only - T& data; // exposition only -public: - const_where_expression(const const_where_expression&) = delete; - const_where_expression& operator=(const const_where_expression&) = delete; - remove_const_t<T> operator-() const &&; - template <class U, class Flags> void copy_to(U* mem, Flags f) const &&; -}; - -template <class M, class T> -class where_expression : public const_where_expression<M, T> { -public: - where_expression(const where_expression&) = delete; - where_expression& operator=(const where_expression&) = delete; - template <class U> void operator=(U&& x); - template <class U> void operator+=(U&& x); - template <class U> void operator-=(U&& x); - template <class U> void operator*=(U&& x); - template <class U> void operator/=(U&& x); - template <class U> void operator%=(U&& x); - template <class U> void operator&=(U&& x); - template <class U> void operator|=(U&& x); - template <class U> void operator^=(U&& x); - template <class U> void operator<<=(U&& x); - template <class U> void operator>>=(U&& x); - void operator++(); - void operator++(int); - void operator--(); - void operator--(int); - template <class U, class Flags> void copy_from(const U* mem, Flags); -}; - -// [simd.class] -template <class T, class Abi> class simd { -public: - using value_type = T; - using reference = see below; - using mask_type = simd_mask<T, Abi>; - - using abi_type = Abi; - static constexpr size_t size() noexcept; - simd() = default; - - // implicit type conversion constructor - template <class U> simd(const simd<U, simd_abi::fixed_size<size()>>&); - - // implicit broadcast constructor (see below for constraints) - template <class U> simd(U&& value); - - // generator constructor (see below for constraints) - template <class G> explicit simd(G&& gen); - - // load constructor - template <class U, class Flags> simd(const U* mem, Flags f); - - // loads [simd.load] - template <class U, class Flags> void copy_from(const U* mem, Flags f); - - // stores [simd.store] - template <class U, class Flags> void copy_to(U* mem, Flags f) const; - - // scalar access [simd.subscr] - reference operator[](size_t); - value_type operator[](size_t) const; - - // unary operators [simd.unary] - simd& operator++(); - simd operator++(int); - simd& operator--(); - simd operator--(int); - mask_type operator!() const; - simd operator~() const; // see below - simd operator+() const; - simd operator-() const; - - // binary operators [simd.binary] - friend simd operator+ (const simd&, const simd&); - friend simd operator- (const simd&, const simd&); - friend simd operator* (const simd&, const simd&); - friend simd operator/ (const simd&, const simd&); - friend simd operator% (const simd&, const simd&); - friend simd operator& (const simd&, const simd&); - friend simd operator| (const simd&, const simd&); - friend simd operator^ (const simd&, const simd&); - friend simd operator<<(const simd&, const simd&); - friend simd operator>>(const simd&, const simd&); - friend simd operator<<(const simd&, int); - friend simd operator>>(const simd&, int); - - // compound assignment [simd.cassign] - friend simd& operator+= (simd&, const simd&); - friend simd& operator-= (simd&, const simd&); - friend simd& operator*= (simd&, const simd&); - friend simd& operator/= (simd&, const simd&); - friend simd& operator%= (simd&, const simd&); - - friend simd& operator&= (simd&, const simd&); - friend simd& operator|= (simd&, const simd&); - friend simd& operator^= (simd&, const simd&); - friend simd& operator<<=(simd&, const simd&); - friend simd& operator>>=(simd&, const simd&); - friend simd& operator<<=(simd&, int); - friend simd& operator>>=(simd&, int); - - // compares [simd.comparison] - friend mask_type operator==(const simd&, const simd&); - friend mask_type operator!=(const simd&, const simd&); - friend mask_type operator>=(const simd&, const simd&); - friend mask_type operator<=(const simd&, const simd&); - friend mask_type operator> (const simd&, const simd&); - friend mask_type operator< (const simd&, const simd&); -}; - -// [simd.math] -template <class Abi> using scharv = simd<signed char, Abi>; // exposition only -template <class Abi> using shortv = simd<short, Abi>; // exposition only -template <class Abi> using intv = simd<int, Abi>; // exposition only -template <class Abi> using longv = simd<long int, Abi>; // exposition only -template <class Abi> using llongv = simd<long long int, Abi>; // exposition only -template <class Abi> using floatv = simd<float, Abi>; // exposition only -template <class Abi> using doublev = simd<double, Abi>; // exposition only -template <class Abi> using ldoublev = simd<long double, Abi>; // exposition only -template <class T, class V> using samesize = fixed_size_simd<T, V::size()>; // exposition only - -template <class Abi> floatv<Abi> acos(floatv<Abi> x); -template <class Abi> doublev<Abi> acos(doublev<Abi> x); -template <class Abi> ldoublev<Abi> acos(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> asin(floatv<Abi> x); -template <class Abi> doublev<Abi> asin(doublev<Abi> x); -template <class Abi> ldoublev<Abi> asin(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> atan(floatv<Abi> x); -template <class Abi> doublev<Abi> atan(doublev<Abi> x); -template <class Abi> ldoublev<Abi> atan(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> atan2(floatv<Abi> y, floatv<Abi> x); -template <class Abi> doublev<Abi> atan2(doublev<Abi> y, doublev<Abi> x); -template <class Abi> ldoublev<Abi> atan2(ldoublev<Abi> y, ldoublev<Abi> x); - -template <class Abi> floatv<Abi> cos(floatv<Abi> x); -template <class Abi> doublev<Abi> cos(doublev<Abi> x); -template <class Abi> ldoublev<Abi> cos(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> sin(floatv<Abi> x); -template <class Abi> doublev<Abi> sin(doublev<Abi> x); -template <class Abi> ldoublev<Abi> sin(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> tan(floatv<Abi> x); -template <class Abi> doublev<Abi> tan(doublev<Abi> x); -template <class Abi> ldoublev<Abi> tan(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> acosh(floatv<Abi> x); -template <class Abi> doublev<Abi> acosh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> acosh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> asinh(floatv<Abi> x); -template <class Abi> doublev<Abi> asinh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> asinh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> atanh(floatv<Abi> x); -template <class Abi> doublev<Abi> atanh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> atanh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> cosh(floatv<Abi> x); -template <class Abi> doublev<Abi> cosh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> cosh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> sinh(floatv<Abi> x); -template <class Abi> doublev<Abi> sinh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> sinh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> tanh(floatv<Abi> x); -template <class Abi> doublev<Abi> tanh(doublev<Abi> x); -template <class Abi> ldoublev<Abi> tanh(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> exp(floatv<Abi> x); -template <class Abi> doublev<Abi> exp(doublev<Abi> x); -template <class Abi> ldoublev<Abi> exp(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> exp2(floatv<Abi> x); -template <class Abi> doublev<Abi> exp2(doublev<Abi> x); -template <class Abi> ldoublev<Abi> exp2(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> expm1(floatv<Abi> x); -template <class Abi> doublev<Abi> expm1(doublev<Abi> x); -template <class Abi> ldoublev<Abi> expm1(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> frexp(floatv<Abi> value, samesize<int, floatv<Abi>>* exp); -template <class Abi> doublev<Abi> frexp(doublev<Abi> value, samesize<int, doublev<Abi>>* exp); -template <class Abi> ldoublev<Abi> frexp(ldoublev<Abi> value, samesize<int, ldoublev<Abi>>* exp); - -template <class Abi> samesize<int, floatv<Abi>> ilogb(floatv<Abi> x); -template <class Abi> samesize<int, doublev<Abi>> ilogb(doublev<Abi> x); -template <class Abi> samesize<int, ldoublev<Abi>> ilogb(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> ldexp(floatv<Abi> x, samesize<int, floatv<Abi>> exp); -template <class Abi> doublev<Abi> ldexp(doublev<Abi> x, samesize<int, doublev<Abi>> exp); -template <class Abi> ldoublev<Abi> ldexp(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> exp); - -template <class Abi> floatv<Abi> log(floatv<Abi> x); -template <class Abi> doublev<Abi> log(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> log10(floatv<Abi> x); -template <class Abi> doublev<Abi> log10(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log10(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> log1p(floatv<Abi> x); -template <class Abi> doublev<Abi> log1p(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log1p(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> log2(floatv<Abi> x); -template <class Abi> doublev<Abi> log2(doublev<Abi> x); -template <class Abi> ldoublev<Abi> log2(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> logb(floatv<Abi> x); -template <class Abi> doublev<Abi> logb(doublev<Abi> x); -template <class Abi> ldoublev<Abi> logb(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> modf(floatv<Abi> value, floatv<Abi>* iptr); -template <class Abi> doublev<Abi> modf(doublev<Abi> value, doublev<Abi>* iptr); -template <class Abi> ldoublev<Abi> modf(ldoublev<Abi> value, ldoublev<Abi>* iptr); - -template <class Abi> floatv<Abi> scalbn(floatv<Abi> x, samesize<int, floatv<Abi>> n); -template <class Abi> doublev<Abi> scalbn(doublev<Abi> x, samesize<int, doublev<Abi>> n); -template <class Abi> ldoublev<Abi> scalbn(ldoublev<Abi> x, samesize<int, ldoublev<Abi>> n); -template <class Abi> floatv<Abi> scalbln(floatv<Abi> x, samesize<long int, floatv<Abi>> n); -template <class Abi> doublev<Abi> scalbln(doublev<Abi> x, samesize<long int, doublev<Abi>> n); -template <class Abi> ldoublev<Abi> scalbln(ldoublev<Abi> x, samesize<long int, ldoublev<Abi>> n); - -template <class Abi> floatv<Abi> cbrt(floatv<Abi> x); -template <class Abi> doublev<Abi> cbrt(doublev<Abi> x); -template <class Abi> ldoublev<Abi> cbrt(ldoublev<Abi> x); - -template <class Abi> scharv<Abi> abs(scharv<Abi> j); -template <class Abi> shortv<Abi> abs(shortv<Abi> j); -template <class Abi> intv<Abi> abs(intv<Abi> j); -template <class Abi> longv<Abi> abs(longv<Abi> j); -template <class Abi> llongv<Abi> abs(llongv<Abi> j); -template <class Abi> floatv<Abi> abs(floatv<Abi> j); -template <class Abi> doublev<Abi> abs(doublev<Abi> j); -template <class Abi> ldoublev<Abi> abs(ldoublev<Abi> j); - -template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y); -template <class Abi> floatv<Abi> hypot(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); -template <class Abi> doublev<Abi> hypot(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); -template <class Abi> ldoublev<Abi> hypot(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); - -template <class Abi> floatv<Abi> pow(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> pow(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> pow(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> sqrt(floatv<Abi> x); -template <class Abi> doublev<Abi> sqrt(doublev<Abi> x); -template <class Abi> ldoublev<Abi> sqrt(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> erf(floatv<Abi> x); -template <class Abi> doublev<Abi> erf(doublev<Abi> x); -template <class Abi> ldoublev<Abi> erf(ldoublev<Abi> x); -template <class Abi> floatv<Abi> erfc(floatv<Abi> x); -template <class Abi> doublev<Abi> erfc(doublev<Abi> x); -template <class Abi> ldoublev<Abi> erfc(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> lgamma(floatv<Abi> x); -template <class Abi> doublev<Abi> lgamma(doublev<Abi> x); -template <class Abi> ldoublev<Abi> lgamma(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> tgamma(floatv<Abi> x); -template <class Abi> doublev<Abi> tgamma(doublev<Abi> x); -template <class Abi> ldoublev<Abi> tgamma(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> ceil(floatv<Abi> x); -template <class Abi> doublev<Abi> ceil(doublev<Abi> x); -template <class Abi> ldoublev<Abi> ceil(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> floor(floatv<Abi> x); -template <class Abi> doublev<Abi> floor(doublev<Abi> x); -template <class Abi> ldoublev<Abi> floor(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> nearbyint(floatv<Abi> x); -template <class Abi> doublev<Abi> nearbyint(doublev<Abi> x); -template <class Abi> ldoublev<Abi> nearbyint(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> rint(floatv<Abi> x); -template <class Abi> doublev<Abi> rint(doublev<Abi> x); -template <class Abi> ldoublev<Abi> rint(ldoublev<Abi> x); - -template <class Abi> samesize<long int, floatv<Abi>> lrint(floatv<Abi> x); -template <class Abi> samesize<long int, doublev<Abi>> lrint(doublev<Abi> x); -template <class Abi> samesize<long int, ldoublev<Abi>> lrint(ldoublev<Abi> x); -template <class Abi> samesize<long long int, floatv<Abi>> llrint(floatv<Abi> x); -template <class Abi> samesize<long long int, doublev<Abi>> llrint(doublev<Abi> x); -template <class Abi> samesize<long long int, ldoublev<Abi>> llrint(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> round(floatv<Abi> x); -template <class Abi> doublev<Abi> round(doublev<Abi> x); -template <class Abi> ldoublev<Abi> round(ldoublev<Abi> x); -template <class Abi> samesize<long int, floatv<Abi>> lround(floatv<Abi> x); -template <class Abi> samesize<long int, doublev<Abi>> lround(doublev<Abi> x); -template <class Abi> samesize<long int, ldoublev<Abi>> lround(ldoublev<Abi> x); -template <class Abi> samesize<long long int, floatv<Abi>> llround(floatv<Abi> x); -template <class Abi> samesize<long long int, doublev<Abi>> llround(doublev<Abi> x); -template <class Abi> samesize<long long int, ldoublev<Abi>> llround(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> trunc(floatv<Abi> x); -template <class Abi> doublev<Abi> trunc(doublev<Abi> x); -template <class Abi> ldoublev<Abi> trunc(ldoublev<Abi> x); - -template <class Abi> floatv<Abi> fmod(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fmod(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fmod(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> remainder(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> remainder(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> remainder(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> remquo(floatv<Abi> x, floatv<Abi> y, samesize<int, floatv<Abi>>* quo); -template <class Abi> doublev<Abi> remquo(doublev<Abi> x, doublev<Abi> y, samesize<int, doublev<Abi>>* quo); -template <class Abi> ldoublev<Abi> remquo(ldoublev<Abi> x, ldoublev<Abi> y, samesize<int, ldoublev<Abi>>* quo); - -template <class Abi> floatv<Abi> copysign(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> copysign(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> copysign(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> doublev<Abi> nan(const char* tagp); -template <class Abi> floatv<Abi> nanf(const char* tagp); -template <class Abi> ldoublev<Abi> nanl(const char* tagp); - -template <class Abi> floatv<Abi> nextafter(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> nextafter(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> nextafter(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> nexttoward(floatv<Abi> x, ldoublev<Abi> y); -template <class Abi> doublev<Abi> nexttoward(doublev<Abi> x, ldoublev<Abi> y); -template <class Abi> ldoublev<Abi> nexttoward(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fdim(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fdim(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fdim(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fmax(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fmax(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fmax(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fmin(floatv<Abi> x, floatv<Abi> y); -template <class Abi> doublev<Abi> fmin(doublev<Abi> x, doublev<Abi> y); -template <class Abi> ldoublev<Abi> fmin(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> floatv<Abi> fma(floatv<Abi> x, floatv<Abi> y, floatv<Abi> z); -template <class Abi> doublev<Abi> fma(doublev<Abi> x, doublev<Abi> y, doublev<Abi> z); -template <class Abi> ldoublev<Abi> fma(ldoublev<Abi> x, ldoublev<Abi> y, ldoublev<Abi> z); - -template <class Abi> samesize<int, floatv<Abi>> fpclassify(floatv<Abi> x); -template <class Abi> samesize<int, doublev<Abi>> fpclassify(doublev<Abi> x); -template <class Abi> samesize<int, ldoublev<Abi>> fpclassify(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isfinite(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isfinite(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isfinite(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isinf(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isinf(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isinf(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isnan(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isnan(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isnan(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isnormal(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> isnormal(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> isnormal(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> signbit(floatv<Abi> x); -template <class Abi> simd_mask<double, Abi> signbit(doublev<Abi> x); -template <class Abi> simd_mask<long double, Abi> signbit(ldoublev<Abi> x); - -template <class Abi> simd_mask<float, Abi> isgreater(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isgreater(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isgreater(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> isgreaterequal(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isgreaterequal(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isgreaterequal(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> isless(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isless(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isless(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> islessequal(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> islessequal(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> islessequal(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> islessgreater(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> islessgreater(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> islessgreater(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class Abi> simd_mask<float, Abi> isunordered(floatv<Abi> x, floatv<Abi> y); -template <class Abi> simd_mask<double, Abi> isunordered(doublev<Abi> x, doublev<Abi> y); -template <class Abi> simd_mask<long double, Abi> isunordered(ldoublev<Abi> x, ldoublev<Abi> y); - -template <class V> struct simd_div_t { V quot, rem; }; -template <class Abi> simd_div_t<scharv<Abi>> div(scharv<Abi> numer, scharv<Abi> denom); -template <class Abi> simd_div_t<shortv<Abi>> div(shortv<Abi> numer, shortv<Abi> denom); -template <class Abi> simd_div_t<intv<Abi>> div(intv<Abi> numer, intv<Abi> denom); -template <class Abi> simd_div_t<longv<Abi>> div(longv<Abi> numer, longv<Abi> denom); -template <class Abi> simd_div_t<llongv<Abi>> div(llongv<Abi> numer, llongv<Abi> denom); - -// [simd.mask.class] -template <class T, class Abi> -class simd_mask { -public: - using value_type = bool; - using reference = see below; - using simd_type = simd<T, Abi>; - using abi_type = Abi; - static constexpr size_t size() noexcept; - simd_mask() = default; - - // broadcast constructor - explicit simd_mask(value_type) noexcept; - - // implicit type conversion constructor - template <class U> simd_mask(const simd_mask<U, simd_abi::fixed_size<size()>>&) noexcept; - - // load constructor - template <class Flags> simd_mask(const value_type* mem, Flags); - - // loads [simd.mask.copy] - template <class Flags> void copy_from(const value_type* mem, Flags); - template <class Flags> void copy_to(value_type* mem, Flags) const; - - // scalar access [simd.mask.subscr] - reference operator[](size_t); - value_type operator[](size_t) const; - - // unary operators [simd.mask.unary] - simd_mask operator!() const noexcept; - - // simd_mask binary operators [simd.mask.binary] - friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator& (const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator| (const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator^ (const simd_mask&, const simd_mask&) noexcept; - - // simd_mask compound assignment [simd.mask.cassign] - friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; - - // simd_mask compares [simd.mask.comparison] - friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; -}; - -} // parallelism_v2 -} // std::experimental - -*/ - -#include <algorithm> -#include <array> -#include <cstddef> -#include <experimental/__config> -#include <functional> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD - -#if _LIBCPP_STD_VER >= 17 - -enum class _StorageKind { - _Scalar, - _Array, - _VecExt, -}; - -template <_StorageKind __kind, int _Np> -struct __simd_abi {}; - -template <class _Tp, class _Abi> -class __simd_storage {}; - -template <class _Tp, int __num_element> -class __simd_storage<_Tp, __simd_abi<_StorageKind::_Array, __num_element>> { - std::array<_Tp, __num_element> __storage_; - - template <class, class> - friend struct simd; - - template <class, class> - friend struct simd_mask; - -public: - _Tp __get(size_t __index) const noexcept { return __storage_[__index]; } - void __set(size_t __index, _Tp __val) noexcept { - __storage_[__index] = __val; - } -}; - -template <class _Tp> -class __simd_storage<_Tp, __simd_abi<_StorageKind::_Scalar, 1>> { - _Tp __storage_; - - template <class, class> - friend struct simd; - - template <class, class> - friend struct simd_mask; - -public: - _Tp __get(size_t __index) const noexcept { return (&__storage_)[__index]; } - void __set(size_t __index, _Tp __val) noexcept { - (&__storage_)[__index] = __val; - } -}; - -#ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION - -constexpr size_t __floor_pow_of_2(size_t __val) { - return ((__val - 1) & __val) == 0 ? __val - : __floor_pow_of_2((__val - 1) & __val); -} - -constexpr size_t __ceil_pow_of_2(size_t __val) { - return __val == 1 ? 1 : __floor_pow_of_2(__val - 1) << 1; -} - -template <class _Tp, size_t __bytes> -struct __vec_ext_traits { -#if !defined(_LIBCPP_COMPILER_CLANG_BASED) - typedef _Tp type __attribute__((vector_size(__ceil_pow_of_2(__bytes)))); -#endif -}; - -#if defined(_LIBCPP_COMPILER_CLANG_BASED) -#define _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, _NUM_ELEMENT) \ - template <> \ - struct __vec_ext_traits<_TYPE, sizeof(_TYPE) * _NUM_ELEMENT> { \ - using type = \ - _TYPE __attribute__((vector_size(sizeof(_TYPE) * _NUM_ELEMENT))); \ - } - -#define _LIBCPP_SPECIALIZE_VEC_EXT_32(_TYPE) \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 1); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 2); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 3); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 4); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 5); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 6); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 7); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 8); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 9); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 10); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 11); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 12); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 13); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 14); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 15); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 16); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 17); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 18); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 19); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 20); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 21); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 22); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 23); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 24); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 25); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 26); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 27); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 28); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 29); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 30); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 31); \ - _LIBCPP_SPECIALIZE_VEC_EXT(_TYPE, 32) - -_LIBCPP_SPECIALIZE_VEC_EXT_32(char); -_LIBCPP_SPECIALIZE_VEC_EXT_32(char16_t); -_LIBCPP_SPECIALIZE_VEC_EXT_32(char32_t); -_LIBCPP_SPECIALIZE_VEC_EXT_32(wchar_t); -_LIBCPP_SPECIALIZE_VEC_EXT_32(signed char); -_LIBCPP_SPECIALIZE_VEC_EXT_32(signed short); -_LIBCPP_SPECIALIZE_VEC_EXT_32(signed int); -_LIBCPP_SPECIALIZE_VEC_EXT_32(signed long); -_LIBCPP_SPECIALIZE_VEC_EXT_32(signed long long); -_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned char); -_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned short); -_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned int); -_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned long); -_LIBCPP_SPECIALIZE_VEC_EXT_32(unsigned long long); -_LIBCPP_SPECIALIZE_VEC_EXT_32(float); -_LIBCPP_SPECIALIZE_VEC_EXT_32(double); -_LIBCPP_SPECIALIZE_VEC_EXT_32(long double); - -#undef _LIBCPP_SPECIALIZE_VEC_EXT_32 -#undef _LIBCPP_SPECIALIZE_VEC_EXT -#endif - -template <class _Tp, int __num_element> -class __simd_storage<_Tp, __simd_abi<_StorageKind::_VecExt, __num_element>> { - using _StorageType = - typename __vec_ext_traits<_Tp, sizeof(_Tp) * __num_element>::type; - - _StorageType __storage_; - - template <class, class> - friend struct simd; - - template <class, class> - friend struct simd_mask; - -public: - _Tp __get(size_t __index) const noexcept { return __storage_[__index]; } - void __set(size_t __index, _Tp __val) noexcept { - __storage_[__index] = __val; - } -}; - -#endif // _LIBCPP_HAS_NO_VECTOR_EXTENSION - -template <class _Vp, class _Tp, class _Abi> -class __simd_reference { - static_assert(std::is_same<_Vp, _Tp>::value, ""); - - template <class, class> - friend struct simd; - - template <class, class> - friend struct simd_mask; - - __simd_storage<_Tp, _Abi>* __ptr_; - size_t __index_; - - __simd_reference(__simd_storage<_Tp, _Abi>* __ptr, size_t __index) - : __ptr_(__ptr), __index_(__index) {} - - __simd_reference(const __simd_reference&) = default; - -public: - __simd_reference() = delete; - __simd_reference& operator=(const __simd_reference&) = delete; - - operator _Vp() const { return __ptr_->__get(__index_); } - - __simd_reference operator=(_Vp __value) && { - __ptr_->__set(__index_, __value); - return *this; - } - - __simd_reference operator++() && { - return std::move(*this) = __ptr_->__get(__index_) + 1; - } - - _Vp operator++(int) && { - auto __val = __ptr_->__get(__index_); - __ptr_->__set(__index_, __val + 1); - return __val; - } - - __simd_reference operator--() && { - return std::move(*this) = __ptr_->__get(__index_) - 1; - } - - _Vp operator--(int) && { - auto __val = __ptr_->__get(__index_); - __ptr_->__set(__index_, __val - 1); - return __val; - } - - __simd_reference operator+=(_Vp __value) && { - return std::move(*this) = __ptr_->__get(__index_) + __value; - } - - __simd_reference operator-=(_Vp __value) && { - return std::move(*this) = __ptr_->__get(__index_) - __value; - } - - __simd_reference operator*=(_Vp __value) && { - return std::move(*this) = __ptr_->__get(__index_) * __value; - } - - __simd_reference operator/=(_Vp __value) && { - return std::move(*this) = __ptr_->__get(__index_) / __value; - } - - __simd_reference operator%=(_Vp __value) && { - return std::move(*this) = __ptr_->__get(__index_) % __value; - } - - __simd_reference operator>>=(_Vp __value) && { - return std::move(*this) = __ptr_->__get(__index_) >> __value; - } - - __simd_reference operator<<=(_Vp __value) && { - return std::move(*this) = __ptr_->__get(__index_) << __value; - } - - __simd_reference operator&=(_Vp __value) && { - return std::move(*this) = __ptr_->__get(__index_) & __value; - } - - __simd_reference operator|=(_Vp __value) && { - return std::move(*this) = __ptr_->__get(__index_) | __value; - } - - __simd_reference operator^=(_Vp __value) && { - return std::move(*this) = __ptr_->__get(__index_) ^ __value; - } -}; - -template <class _To, class _From> -constexpr decltype(_To{std::declval<_From>()}, true) -__is_non_narrowing_convertible_impl(_From) { - return true; -} - -template <class _To> -constexpr bool __is_non_narrowing_convertible_impl(...) { - return false; -} - -template <class _From, class _To> -constexpr typename std::enable_if<std::is_arithmetic<_To>::value && - std::is_arithmetic<_From>::value, - bool>::type -__is_non_narrowing_arithmetic_convertible() { - return __is_non_narrowing_convertible_impl<_To>(_From{}); -} - -template <class _From, class _To> -constexpr typename std::enable_if<!(std::is_arithmetic<_To>::value && - std::is_arithmetic<_From>::value), - bool>::type -__is_non_narrowing_arithmetic_convertible() { - return false; -} - -template <class _Tp> -constexpr _Tp __variadic_sum() { - return _Tp{}; -} - -template <class _Tp, class _Up, class... _Args> -constexpr _Tp __variadic_sum(_Up __first, _Args... __rest) { - return static_cast<_Tp>(__first) + __variadic_sum<_Tp>(__rest...); -} - -template <class _Tp> -struct __nodeduce { - using type = _Tp; -}; - -template <class _Tp> -constexpr bool __vectorizable() { - return std::is_arithmetic<_Tp>::value && !std::is_const<_Tp>::value && - !std::is_volatile<_Tp>::value && !std::is_same<_Tp, bool>::value; -} - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI - -using scalar = __simd_abi<_StorageKind::_Scalar, 1>; - -template <int _Np> -using fixed_size = __simd_abi<_StorageKind::_Array, _Np>; - -template <class _Tp> -inline constexpr size_t max_fixed_size = 32; - -template <class _Tp> -using compatible = fixed_size<16 / sizeof(_Tp)>; - -#ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION -template <class _Tp> -using native = __simd_abi<_StorageKind::_VecExt, - _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>; -#else -template <class _Tp> -using native = - fixed_size<_Tp, _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>; -#endif // _LIBCPP_HAS_NO_VECTOR_EXTENSION - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI -_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD - -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> -class simd; -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> -class simd_mask; - -struct element_aligned_tag {}; -struct vector_aligned_tag {}; -template <size_t> -struct overaligned_tag {}; -inline constexpr element_aligned_tag element_aligned{}; -inline constexpr vector_aligned_tag vector_aligned{}; -template <size_t _Np> -inline constexpr overaligned_tag<_Np> overaligned{}; - -// traits [simd.traits] -template <class _Tp> -struct is_abi_tag : std::integral_constant<bool, false> {}; - -template <_StorageKind __kind, int _Np> -struct is_abi_tag<__simd_abi<__kind, _Np>> - : std::integral_constant<bool, true> {}; - -template <class _Tp> -struct is_simd : std::integral_constant<bool, false> {}; - -template <class _Tp, class _Abi> -struct is_simd<simd<_Tp, _Abi>> : std::integral_constant<bool, true> {}; - -template <class _Tp> -struct is_simd_mask : std::integral_constant<bool, false> {}; - -template <class _Tp, class _Abi> -struct is_simd_mask<simd_mask<_Tp, _Abi>> : std::integral_constant<bool, true> { -}; - -template <class _Tp> -struct is_simd_flag_type : std::integral_constant<bool, false> {}; - -template <> -struct is_simd_flag_type<element_aligned_tag> - : std::integral_constant<bool, true> {}; - -template <> -struct is_simd_flag_type<vector_aligned_tag> - : std::integral_constant<bool, true> {}; - -template <size_t _Align> -struct is_simd_flag_type<overaligned_tag<_Align>> - : std::integral_constant<bool, true> {}; - -template <class _Tp> -inline constexpr bool is_abi_tag_v = is_abi_tag<_Tp>::value; -template <class _Tp> -inline constexpr bool is_simd_v = is_simd<_Tp>::value; -template <class _Tp> -inline constexpr bool is_simd_mask_v = is_simd_mask<_Tp>::value; -template <class _Tp> -inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<_Tp>::value; -template <class _Tp, size_t _Np> -struct abi_for_size { - using type = simd_abi::fixed_size<_Np>; -}; -template <class _Tp, size_t _Np> -using abi_for_size_t = typename abi_for_size<_Tp, _Np>::type; - -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> -struct simd_size; - -template <class _Tp, _StorageKind __kind, int _Np> -struct simd_size<_Tp, __simd_abi<__kind, _Np>> - : std::integral_constant<size_t, _Np> { - static_assert( - std::is_arithmetic<_Tp>::value && - !std::is_same<typename std::remove_const<_Tp>::type, bool>::value, - "Element type should be vectorizable"); -}; - -// TODO: implement it. -template <class _Tp, class _Up = typename _Tp::value_type> -struct memory_alignment; - -template <class _Tp, class _Abi = simd_abi::compatible<_Tp>> -inline constexpr size_t simd_size_v = simd_size<_Tp, _Abi>::value; - -template <class _Tp, class _Up = typename _Tp::value_type> -inline constexpr size_t memory_alignment_v = memory_alignment<_Tp, _Up>::value; - -// class template simd [simd.class] -template <class _Tp> -using native_simd = simd<_Tp, simd_abi::native<_Tp>>; -template <class _Tp, int _Np> -using fixed_size_simd = simd<_Tp, simd_abi::fixed_size<_Np>>; - -// class template simd_mask [simd.mask.class] -template <class _Tp> -using native_simd_mask = simd_mask<_Tp, simd_abi::native<_Tp>>; - -template <class _Tp, int _Np> -using fixed_size_simd_mask = simd_mask<_Tp, simd_abi::fixed_size<_Np>>; - -// casts [simd.casts] -template <class _Tp> -struct __static_simd_cast_traits { - template <class _Up, class _Abi> - static simd<_Tp, _Abi> __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp, class _NewAbi> -struct __static_simd_cast_traits<simd<_Tp, _NewAbi>> { - template <class _Up, class _Abi> - static typename std::enable_if<simd<_Up, _Abi>::size() == - simd<_Tp, _NewAbi>::size(), - simd<_Tp, _NewAbi>>::type - __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp> -struct __simd_cast_traits { - template <class _Up, class _Abi> - static typename std::enable_if< - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>(), - simd<_Tp, _Abi>>::type - __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp, class _NewAbi> -struct __simd_cast_traits<simd<_Tp, _NewAbi>> { - template <class _Up, class _Abi> - static typename std::enable_if< - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>() && - simd<_Up, _Abi>::size() == simd<_Tp, _NewAbi>::size(), - simd<_Tp, _NewAbi>>::type - __apply(const simd<_Up, _Abi>& __v); -}; - -template <class _Tp, class _Up, class _Abi> -auto simd_cast(const simd<_Up, _Abi>& __v) - -> decltype(__simd_cast_traits<_Tp>::__apply(__v)) { - return __simd_cast_traits<_Tp>::__apply(__v); -} - -template <class _Tp, class _Up, class _Abi> -auto static_simd_cast(const simd<_Up, _Abi>& __v) - -> decltype(__static_simd_cast_traits<_Tp>::__apply(__v)) { - return __static_simd_cast_traits<_Tp>::__apply(__v); -} - -template <class _Tp, class _Abi> -fixed_size_simd<_Tp, simd_size<_Tp, _Abi>::value> -to_fixed_size(const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -fixed_size_simd_mask<_Tp, simd_size<_Tp, _Abi>::value> -to_fixed_size(const simd_mask<_Tp, _Abi>&) noexcept; - -template <class _Tp, size_t _Np> -native_simd<_Tp> to_native(const fixed_size_simd<_Tp, _Np>&) noexcept; - -template <class _Tp, size_t _Np> -native_simd_mask<_Tp> to_native(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; - -template <class _Tp, size_t _Np> -simd<_Tp> to_compatible(const fixed_size_simd<_Tp, _Np>&) noexcept; - -template <class _Tp, size_t _Np> -simd_mask<_Tp> to_compatible(const fixed_size_simd_mask<_Tp, _Np>&) noexcept; - -template <size_t... __sizes, class _Tp, class _Abi> -tuple<simd<_Tp, abi_for_size_t<_Tp, __sizes>>...> split(const simd<_Tp, _Abi>&); - -template <size_t... __sizes, class _Tp, class _Abi> -tuple<simd_mask<_Tp, abi_for_size_t<_Tp, __sizes>>...> -split(const simd_mask<_Tp, _Abi>&); - -template <class _SimdType, class _Abi> -array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / - _SimdType::size()> -split(const simd<typename _SimdType::value_type, _Abi>&); - -template <class _SimdType, class _Abi> -array<_SimdType, simd_size<typename _SimdType::value_type, _Abi>::value / - _SimdType::size()> -split(const simd_mask<typename _SimdType::value_type, _Abi>&); - -template <class _Tp, class... _Abis> -simd<_Tp, abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> -concat(const simd<_Tp, _Abis>&...); - -template <class _Tp, class... _Abis> -simd_mask<_Tp, - abi_for_size_t<_Tp, __variadic_sum(simd_size<_Tp, _Abis>::value...)>> -concat(const simd_mask<_Tp, _Abis>&...); - -// reductions [simd.mask.reductions] -template <class _Tp, class _Abi> -bool all_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -bool any_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -bool none_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -bool some_of(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -int popcount(const simd_mask<_Tp, _Abi>&) noexcept; -template <class _Tp, class _Abi> -int find_first_set(const simd_mask<_Tp, _Abi>&); -template <class _Tp, class _Abi> -int find_last_set(const simd_mask<_Tp, _Abi>&); -bool all_of(bool) noexcept; -bool any_of(bool) noexcept; -bool none_of(bool) noexcept; -bool some_of(bool) noexcept; -int popcount(bool) noexcept; -int find_first_set(bool) noexcept; -int find_last_set(bool) noexcept; - -// masked assignment [simd.whereexpr] -template <class _MaskType, class _Tp> -class const_where_expression; -template <class _MaskType, class _Tp> -class where_expression; - -// masked assignment [simd.mask.where] -template <class _Tp, class _Abi> -where_expression<simd_mask<_Tp, _Abi>, simd<_Tp, _Abi>> -where(const typename simd<_Tp, _Abi>::mask_type&, simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -const_where_expression<simd_mask<_Tp, _Abi>, const simd<_Tp, _Abi>> -where(const typename simd<_Tp, _Abi>::mask_type&, - const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -where_expression<simd_mask<_Tp, _Abi>, simd_mask<_Tp, _Abi>> -where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, - simd_mask<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -const_where_expression<simd_mask<_Tp, _Abi>, const simd_mask<_Tp, _Abi>> -where(const typename __nodeduce<simd_mask<_Tp, _Abi>>::type&, - const simd_mask<_Tp, _Abi>&) noexcept; - -template <class _Tp> -where_expression<bool, _Tp> where(bool, _Tp&) noexcept; - -template <class _Tp> -const_where_expression<bool, const _Tp> where(bool, const _Tp&) noexcept; - -// reductions [simd.reductions] -template <class _Tp, class _Abi, class _BinaryOp = std::plus<_Tp>> -_Tp reduce(const simd<_Tp, _Abi>&, _BinaryOp = _BinaryOp()); - -template <class _MaskType, class _SimdType, class _BinaryOp> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - typename _SimdType::value_type neutral_element, _BinaryOp binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - plus<typename _SimdType::value_type> binary_op = {}); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - multiplies<typename _SimdType::value_type> binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - bit_and<typename _SimdType::value_type> binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - bit_or<typename _SimdType::value_type> binary_op); - -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -reduce(const const_where_expression<_MaskType, _SimdType>&, - bit_xor<typename _SimdType::value_type> binary_op); - -template <class _Tp, class _Abi> -_Tp hmin(const simd<_Tp, _Abi>&); -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -hmin(const const_where_expression<_MaskType, _SimdType>&); -template <class _Tp, class _Abi> -_Tp hmax(const simd<_Tp, _Abi>&); -template <class _MaskType, class _SimdType> -typename _SimdType::value_type -hmax(const const_where_expression<_MaskType, _SimdType>&); - -// algorithms [simd.alg] -template <class _Tp, class _Abi> -simd<_Tp, _Abi> min(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -simd<_Tp, _Abi> max(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -std::pair<simd<_Tp, _Abi>, simd<_Tp, _Abi>> -minmax(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&) noexcept; - -template <class _Tp, class _Abi> -simd<_Tp, _Abi> clamp(const simd<_Tp, _Abi>&, const simd<_Tp, _Abi>&, - const simd<_Tp, _Abi>&); - -// [simd.whereexpr] -// TODO implement where expressions. -template <class _MaskType, class _Tp> -class const_where_expression { -public: - const_where_expression(const const_where_expression&) = delete; - const_where_expression& operator=(const const_where_expression&) = delete; - typename remove_const<_Tp>::type operator-() const&&; - template <class _Up, class _Flags> - void copy_to(_Up*, _Flags) const&&; -}; - -template <class _MaskType, class _Tp> -class where_expression : public const_where_expression<_MaskType, _Tp> { -public: - where_expression(const where_expression&) = delete; - where_expression& operator=(const where_expression&) = delete; - template <class _Up> - void operator=(_Up&&); - template <class _Up> - void operator+=(_Up&&); - template <class _Up> - void operator-=(_Up&&); - template <class _Up> - void operator*=(_Up&&); - template <class _Up> - void operator/=(_Up&&); - template <class _Up> - void operator%=(_Up&&); - template <class _Up> - void operator&=(_Up&&); - template <class _Up> - void operator|=(_Up&&); - template <class _Up> - void operator^=(_Up&&); - template <class _Up> - void operator<<=(_Up&&); - template <class _Up> - void operator>>=(_Up&&); - void operator++(); - void operator++(int); - void operator--(); - void operator--(int); - template <class _Up, class _Flags> - void copy_from(const _Up*, _Flags); -}; - -// [simd.class] -// TODO: implement simd -template <class _Tp, class _Abi> -class simd { -public: - using value_type = _Tp; - using reference = __simd_reference<_Tp, _Tp, _Abi>; - using mask_type = simd_mask<_Tp, _Abi>; - using abi_type = _Abi; - - simd() = default; - simd(const simd&) = default; - simd& operator=(const simd&) = default; - - static constexpr size_t size() noexcept { - return simd_size<_Tp, _Abi>::value; - } - -private: - __simd_storage<_Tp, _Abi> __s_; - - template <class _Up> - static constexpr bool __can_broadcast() { - return (std::is_arithmetic<_Up>::value && - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()) || - (!std::is_arithmetic<_Up>::value && - std::is_convertible<_Up, _Tp>::value) || - std::is_same<typename std::remove_const<_Up>::type, int>::value || - (std::is_same<typename std::remove_const<_Up>::type, - unsigned int>::value && - std::is_unsigned<_Tp>::value); - } - - template <class _Generator, size_t... __indicies> - static constexpr decltype( - std::forward_as_tuple(std::declval<_Generator>()( - std::integral_constant<size_t, __indicies>())...), - bool()) - __can_generate(std::index_sequence<__indicies...>) { - return !__variadic_sum<bool>( - !__can_broadcast<decltype(std::declval<_Generator>()( - std::integral_constant<size_t, __indicies>()))>()...); - } - - template <class _Generator> - static bool __can_generate(...) { - return false; - } - - template <class _Generator, size_t... __indicies> - void __generator_init(_Generator&& __g, std::index_sequence<__indicies...>) { - int __not_used[]{((*this)[__indicies] = - __g(std::integral_constant<size_t, __indicies>()), - 0)...}; - (void)__not_used; - } - -public: - // implicit type conversion constructor - template <class _Up, - class = typename std::enable_if< - std::is_same<_Abi, simd_abi::fixed_size<size()>>::value && - __is_non_narrowing_arithmetic_convertible<_Up, _Tp>()>::type> - simd(const simd<_Up, simd_abi::fixed_size<size()>>& __v) { - for (size_t __i = 0; __i < size(); __i++) { - (*this)[__i] = static_cast<_Tp>(__v[__i]); - } - } - - // implicit broadcast constructor - template <class _Up, - class = typename std::enable_if<__can_broadcast<_Up>()>::type> - simd(_Up&& __rv) { - auto __v = static_cast<_Tp>(__rv); - for (size_t __i = 0; __i < size(); __i++) { - (*this)[__i] = __v; - } - } - - // generator constructor - template <class _Generator, - int = typename std::enable_if< - __can_generate<_Generator>(std::make_index_sequence<size()>()), - int>::type()> - explicit simd(_Generator&& __g) { - __generator_init(std::forward<_Generator>(__g), - std::make_index_sequence<size()>()); - } - - // load constructor - template < - class _Up, class _Flags, - class = typename std::enable_if<__vectorizable<_Up>()>::type, - class = typename std::enable_if<is_simd_flag_type<_Flags>::value>::type> - simd(const _Up* __buffer, _Flags) { - // TODO: optimize for overaligned flags - for (size_t __i = 0; __i < size(); __i++) { - (*this)[__i] = static_cast<_Tp>(__buffer[__i]); - } - } - - // loads [simd.load] - template <class _Up, class _Flags> - typename std::enable_if<__vectorizable<_Up>() && - is_simd_flag_type<_Flags>::value>::type - copy_from(const _Up* __buffer, _Flags) { - *this = simd(__buffer, _Flags()); - } - - // stores [simd.store] - template <class _Up, class _Flags> - typename std::enable_if<__vectorizable<_Up>() && - is_simd_flag_type<_Flags>::value>::type - copy_to(_Up* __buffer, _Flags) const { - // TODO: optimize for overaligned flags - for (size_t __i = 0; __i < size(); __i++) { - __buffer[__i] = static_cast<_Up>((*this)[__i]); - } - } - - // scalar access [simd.subscr] - reference operator[](size_t __i) { return reference(&__s_, __i); } - - value_type operator[](size_t __i) const { return __s_.__get(__i); } - - // unary operators [simd.unary] - simd& operator++(); - simd operator++(int); - simd& operator--(); - simd operator--(int); - mask_type operator!() const; - simd operator~() const; - simd operator+() const; - simd operator-() const; - - // binary operators [simd.binary] - friend simd operator+(const simd&, const simd&); - friend simd operator-(const simd&, const simd&); - friend simd operator*(const simd&, const simd&); - friend simd operator/(const simd&, const simd&); - friend simd operator%(const simd&, const simd&); - friend simd operator&(const simd&, const simd&); - friend simd operator|(const simd&, const simd&); - friend simd operator^(const simd&, const simd&); - friend simd operator<<(const simd&, const simd&); - friend simd operator>>(const simd&, const simd&); - friend simd operator<<(const simd&, int); - friend simd operator>>(const simd&, int); - - // compound assignment [simd.cassign] - friend simd& operator+=(simd&, const simd&); - friend simd& operator-=(simd&, const simd&); - friend simd& operator*=(simd&, const simd&); - friend simd& operator/=(simd&, const simd&); - friend simd& operator%=(simd&, const simd&); - - friend simd& operator&=(simd&, const simd&); - friend simd& operator|=(simd&, const simd&); - friend simd& operator^=(simd&, const simd&); - friend simd& operator<<=(simd&, const simd&); - friend simd& operator>>=(simd&, const simd&); - friend simd& operator<<=(simd&, int); - friend simd& operator>>=(simd&, int); - - // compares [simd.comparison] - friend mask_type operator==(const simd&, const simd&); - friend mask_type operator!=(const simd&, const simd&); - friend mask_type operator>=(const simd&, const simd&); - friend mask_type operator<=(const simd&, const simd&); - friend mask_type operator>(const simd&, const simd&); - friend mask_type operator<(const simd&, const simd&); -}; - -// [simd.mask.class] -template <class _Tp, class _Abi> -// TODO: implement simd_mask -class simd_mask { -public: - using value_type = bool; - // TODO: this is strawman implementation. Turn it into a proxy type. - using reference = bool&; - using simd_type = simd<_Tp, _Abi>; - using abi_type = _Abi; - static constexpr size_t size() noexcept; - simd_mask() = default; - - // broadcast constructor - explicit simd_mask(value_type) noexcept; - - // implicit type conversion constructor - template <class _Up> - simd_mask(const simd_mask<_Up, simd_abi::fixed_size<size()>>&) noexcept; - - // load constructor - template <class _Flags> - simd_mask(const value_type*, _Flags); - - // loads [simd.mask.copy] - template <class _Flags> - void copy_from(const value_type*, _Flags); - template <class _Flags> - void copy_to(value_type*, _Flags) const; - - // scalar access [simd.mask.subscr] - reference operator[](size_t); - value_type operator[](size_t) const; - - // unary operators [simd.mask.unary] - simd_mask operator!() const noexcept; - - // simd_mask binary operators [simd.mask.binary] - friend simd_mask operator&&(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator||(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator&(const simd_mask&, const simd_mask&)noexcept; - friend simd_mask operator|(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator^(const simd_mask&, const simd_mask&) noexcept; - - // simd_mask compound assignment [simd.mask.cassign] - friend simd_mask& operator&=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator|=(simd_mask&, const simd_mask&) noexcept; - friend simd_mask& operator^=(simd_mask&, const simd_mask&) noexcept; - - // simd_mask compares [simd.mask.comparison] - friend simd_mask operator==(const simd_mask&, const simd_mask&) noexcept; - friend simd_mask operator!=(const simd_mask&, const simd_mask&) noexcept; -}; - -#endif // _LIBCPP_STD_VER >= 17 - -_LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD - -_LIBCPP_POP_MACROS - -#endif /* _LIBCPP_EXPERIMENTAL_SIMD */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/string b/contrib/libs/cxxsupp/libcxx/include/experimental/string deleted file mode 100644 index aab916778f8..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/string +++ /dev/null @@ -1,63 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_STRING -#define _LIBCPP_EXPERIMENTAL_STRING -/* - experimental/string synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - // basic_string using polymorphic allocator in namespace pmr - template <class charT, class traits = char_traits<charT>> - using basic_string = - std::basic_string<charT, traits, polymorphic_allocator<charT>>; - - // basic_string typedef names using polymorphic allocator in namespace - // std::experimental::pmr - typedef basic_string<char> string; - typedef basic_string<char16_t> u16string; - typedef basic_string<char32_t> u32string; - typedef basic_string<wchar_t> wstring; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <experimental/memory_resource> -#include <string> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _CharT, class _Traits = char_traits<_CharT>> -using basic_string = - _VSTD::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>; - -typedef basic_string<char> string; -typedef basic_string<char16_t> u16string; -typedef basic_string<char32_t> u32string; -#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -typedef basic_string<wchar_t> wstring; -#endif - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_STRING */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/type_traits b/contrib/libs/cxxsupp/libcxx/include/experimental/type_traits deleted file mode 100644 index 707cbde9912..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/type_traits +++ /dev/null @@ -1,154 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_TYPE_TRAITS -#define _LIBCPP_EXPERIMENTAL_TYPE_TRAITS - -/** - experimental/type_traits synopsis - -// C++1y -#include <type_traits> - -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { - - // 3.3.2, Other type transformations - template <class> class invocation_type; // not defined - template <class F, class... ArgTypes> class invocation_type<F(ArgTypes...)>; - template <class> class raw_invocation_type; // not defined - template <class F, class... ArgTypes> class raw_invocation_type<F(ArgTypes...)>; - - template <class T> - using invocation_type_t = typename invocation_type<T>::type; - template <class T> - using raw_invocation_type_t = typename raw_invocation_type<T>::type; - - // 3.3.4, Detection idiom - template <class...> using void_t = void; - - struct nonesuch { - nonesuch() = delete; - ~nonesuch() = delete; - nonesuch(nonesuch const&) = delete; - void operator=(nonesuch const&) = delete; - }; - - template <template<class...> class Op, class... Args> - using is_detected = see below; - template <template<class...> class Op, class... Args> - constexpr bool is_detected_v = is_detected<Op, Args...>::value; - template <template<class...> class Op, class... Args> - using detected_t = see below; - template <class Default, template<class...> class Op, class... Args> - using detected_or = see below; - template <class Default, template<class...> class Op, class... Args> - using detected_or_t = typename detected_or<Default, Op, Args...>::type; - template <class Expected, template<class...> class Op, class... Args> - using is_detected_exact = is_same<Expected, detected_t<Op, Args...>>; - template <class Expected, template<class...> class Op, class... Args> - constexpr bool is_detected_exact_v - = is_detected_exact<Expected, Op, Args...>::value; - template <class To, template<class...> class Op, class... Args> - using is_detected_convertible = is_convertible<detected_t<Op, Args...>, To>; - template <class To, template<class...> class Op, class... Args> - constexpr bool is_detected_convertible_v - = is_detected_convertible<To, Op, Args...>::value; - -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> - -#if _LIBCPP_STD_VER > 11 - -#include <initializer_list> -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS - -// 3.3.2, Other type transformations -/* -template <class> -class _LIBCPP_TEMPLATE_VIS raw_invocation_type; - -template <class _Fn, class ..._Args> -class _LIBCPP_TEMPLATE_VIS raw_invocation_type<_Fn(_Args...)>; - -template <class> -class _LIBCPP_TEMPLATE_VIS invokation_type; - -template <class _Fn, class ..._Args> -class _LIBCPP_TEMPLATE_VIS invokation_type<_Fn(_Args...)>; - -template <class _Tp> -using invokation_type_t = typename invokation_type<_Tp>::type; - -template <class _Tp> -using raw_invocation_type_t = typename raw_invocation_type<_Tp>::type; -*/ - -// 3.3.4, Detection idiom -template <class...> using void_t = void; - -struct nonesuch : private __nat { // make nonesuch "not an aggregate" - ~nonesuch() = delete; - nonesuch (nonesuch const&) = delete; - void operator=(nonesuch const&) = delete; - }; - -template <class _Default, class _AlwaysVoid, template <class...> class _Op, class... _Args> -struct _DETECTOR { - using value_t = false_type; - using type = _Default; - }; - -template <class _Default, template <class...> class _Op, class... _Args> -struct _DETECTOR<_Default, void_t<_Op<_Args...>>, _Op, _Args...> { - using value_t = true_type; - using type = _Op<_Args...>; - }; - - -template <template<class...> class _Op, class... _Args> - using is_detected = typename _DETECTOR<nonesuch, void, _Op, _Args...>::value_t; -template <template<class...> class _Op, class... _Args> - using detected_t = typename _DETECTOR<nonesuch, void, _Op, _Args...>::type; -template <template<class...> class _Op, class... _Args> - _LIBCPP_CONSTEXPR bool is_detected_v = is_detected<_Op, _Args...>::value; - -template <class Default, template<class...> class _Op, class... _Args> - using detected_or = _DETECTOR<Default, void, _Op, _Args...>; -template <class Default, template<class...> class _Op, class... _Args> - using detected_or_t = typename detected_or<Default, _Op, _Args...>::type; - -template <class Expected, template<class...> class _Op, class... _Args> - using is_detected_exact = is_same<Expected, detected_t<_Op, _Args...>>; -template <class Expected, template<class...> class _Op, class... _Args> - _LIBCPP_CONSTEXPR bool is_detected_exact_v = is_detected_exact<Expected, _Op, _Args...>::value; - -template <class To, template<class...> class _Op, class... _Args> - using is_detected_convertible = is_convertible<detected_t<_Op, _Args...>, To>; -template <class To, template<class...> class _Op, class... _Args> - _LIBCPP_CONSTEXPR bool is_detected_convertible_v = is_detected_convertible<To, _Op, _Args...>::value; - - -_LIBCPP_END_NAMESPACE_LFTS - -#endif /* _LIBCPP_STD_VER > 11 */ - -#endif /* _LIBCPP_EXPERIMENTAL_TYPE_TRAITS */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/unordered_map b/contrib/libs/cxxsupp/libcxx/include/experimental/unordered_map deleted file mode 100644 index 069ba203d5b..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/unordered_map +++ /dev/null @@ -1,64 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_UNORDERED_MAP -#define _LIBCPP_EXPERIMENTAL_UNORDERED_MAP -/* - experimental/unordered_map synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - template <class Key, class T, - class Hash = hash<Key>, - class Pred = equal_to<Key>> - using unordered_map = - std::unordered_map<Key, T, Hash, Pred, - polymorphic_allocator<pair<const Key,T>>>; - - template <class Key, class T, - class Hash = hash<Key>, - class Pred = equal_to<Key>> - using unordered_multimap = - std::unordered_multimap<Key, T, Hash, Pred, - polymorphic_allocator<pair<const Key,T>>>; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <experimental/memory_resource> -#include <unordered_map> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _Key, class _Value, - class _Hash = hash<_Key>, class _Pred = equal_to<_Key>> -using unordered_map = _VSTD::unordered_map<_Key, _Value, _Hash, _Pred, - polymorphic_allocator<pair<const _Key, _Value>>>; - -template <class _Key, class _Value, - class _Hash = hash<_Key>, class _Pred = equal_to<_Key>> -using unordered_multimap = _VSTD::unordered_multimap<_Key, _Value, _Hash, _Pred, - polymorphic_allocator<pair<const _Key, _Value>>>; - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_MAP */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/unordered_set b/contrib/libs/cxxsupp/libcxx/include/experimental/unordered_set deleted file mode 100644 index cac6c76414b..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/unordered_set +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_UNORDERED_SET -#define _LIBCPP_EXPERIMENTAL_UNORDERED_SET -/* - experimental/unordered_set synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - template <class T, class Hash = hash<T>, class Pred = equal_to<T>> - using unordered_set = std::unordered_set<T, Hash, Pred, - polymorphic_allocator<T>>; - - template <class T, class Hash = hash<T>, class Pred = equal_to<T>> - using unordered_multiset = std::unordered_multiset<T, Hash, Pred, - polymorphic_allocator<T>>; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <experimental/memory_resource> -#include <unordered_set> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _Value, - class _Hash = hash<_Value>, class _Pred = equal_to<_Value>> -using unordered_set = _VSTD::unordered_set<_Value, _Hash, _Pred, - polymorphic_allocator<_Value>>; - -template <class _Value, - class _Hash = hash<_Value>, class _Pred = equal_to<_Value>> -using unordered_multiset = _VSTD::unordered_multiset<_Value, _Hash, _Pred, - polymorphic_allocator<_Value>>; - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_SET */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/utility b/contrib/libs/cxxsupp/libcxx/include/experimental/utility deleted file mode 100644 index 21650a8d1ec..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/utility +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_UTILITY -#define _LIBCPP_EXPERIMENTAL_UTILITY - -/* - experimental/utility synopsis - -// C++1y - -#include <utility> - -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { - - 3.1.2, erased-type placeholder - struct erased_type { }; - -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <utility> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS - - struct _LIBCPP_TEMPLATE_VIS erased_type { }; - -_LIBCPP_END_NAMESPACE_LFTS - -#endif /* _LIBCPP_EXPERIMENTAL_UTILITY */ diff --git a/contrib/libs/cxxsupp/libcxx/include/experimental/vector b/contrib/libs/cxxsupp/libcxx/include/experimental/vector deleted file mode 100644 index 1eb792758f4..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/experimental/vector +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXPERIMENTAL_VECTOR -#define _LIBCPP_EXPERIMENTAL_VECTOR -/* - experimental/vector synopsis - -// C++1z -namespace std { -namespace experimental { -inline namespace fundamentals_v1 { -namespace pmr { - - template <class T> - using vector = std::vector<T, polymorphic_allocator<T>>; - -} // namespace pmr -} // namespace fundamentals_v1 -} // namespace experimental -} // namespace std - - */ - -#include <experimental/__config> -#include <experimental/memory_resource> -#include <vector> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR - -template <class _ValueT> -using vector = _VSTD::vector<_ValueT, polymorphic_allocator<_ValueT>>; - -_LIBCPP_END_NAMESPACE_LFTS_PMR - -#endif /* _LIBCPP_EXPERIMENTAL_VECTOR */ diff --git a/contrib/libs/cxxsupp/libcxx/include/ext/__hash b/contrib/libs/cxxsupp/libcxx/include/ext/__hash deleted file mode 100644 index 92bd0824634..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/ext/__hash +++ /dev/null @@ -1,134 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_EXT_HASH -#define _LIBCPP_EXT_HASH - -# pragma GCC system_header - -#include <__string> -#include <cstring> -#include <string> - -namespace __gnu_cxx { - -template <typename _Tp> struct _LIBCPP_TEMPLATE_VIS hash { }; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<const char*> - : public std::unary_function<const char*, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(const char *__c) const _NOEXCEPT - { - return std::__do_string_hash(__c, __c + strlen(__c)); - } -}; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<char *> - : public std::unary_function<char*, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(char *__c) const _NOEXCEPT - { - return std::__do_string_hash<const char *>(__c, __c + strlen(__c)); - } -}; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<char> - : public std::unary_function<char, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(char __c) const _NOEXCEPT - { - return __c; - } -}; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<signed char> - : public std::unary_function<signed char, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(signed char __c) const _NOEXCEPT - { - return __c; - } -}; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned char> - : public std::unary_function<unsigned char, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(unsigned char __c) const _NOEXCEPT - { - return __c; - } -}; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<short> - : public std::unary_function<short, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(short __c) const _NOEXCEPT - { - return __c; - } -}; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned short> - : public std::unary_function<unsigned short, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(unsigned short __c) const _NOEXCEPT - { - return __c; - } -}; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<int> - : public std::unary_function<int, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(int __c) const _NOEXCEPT - { - return __c; - } -}; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned int> - : public std::unary_function<unsigned int, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(unsigned int __c) const _NOEXCEPT - { - return __c; - } -}; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<long> - : public std::unary_function<long, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(long __c) const _NOEXCEPT - { - return __c; - } -}; - -template <> struct _LIBCPP_TEMPLATE_VIS hash<unsigned long> - : public std::unary_function<unsigned long, size_t> -{ - _LIBCPP_INLINE_VISIBILITY - size_t operator()(unsigned long __c) const _NOEXCEPT - { - return __c; - } -}; -} // namespace __gnu_cxx - -#endif // _LIBCPP_EXT_HASH diff --git a/contrib/libs/cxxsupp/libcxx/include/ext/hash_map b/contrib/libs/cxxsupp/libcxx/include/ext/hash_map deleted file mode 100644 index 4d9c08cd261..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/ext/hash_map +++ /dev/null @@ -1,984 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_HASH_MAP -#define _LIBCPP_HASH_MAP - -/* - - hash_map synopsis - -namespace __gnu_cxx -{ - -template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, - class Alloc = allocator<pair<const Key, T>>> -class hash_map -{ -public: - // types - typedef Key key_type; - typedef T mapped_type; - typedef Hash hasher; - typedef Pred key_equal; - typedef Alloc allocator_type; - typedef pair<const key_type, mapped_type> value_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef typename allocator_traits<allocator_type>::pointer pointer; - typedef typename allocator_traits<allocator_type>::const_pointer const_pointer; - typedef typename allocator_traits<allocator_type>::size_type size_type; - typedef typename allocator_traits<allocator_type>::difference_type difference_type; - - typedef /unspecified/ iterator; - typedef /unspecified/ const_iterator; - - hash_map(); - explicit hash_map(size_type n, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - template <class InputIterator> - hash_map(InputIterator f, InputIterator l); - template <class InputIterator> - hash_map(InputIterator f, InputIterator l, - size_type n, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - hash_map(const hash_map&); - ~hash_map(); - hash_map& operator=(const hash_map&); - - allocator_type get_allocator() const; - - bool empty() const; - size_type size() const; - size_type max_size() const; - - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - - pair<iterator, bool> insert(const value_type& obj); - template <class InputIterator> - void insert(InputIterator first, InputIterator last); - - void erase(const_iterator position); - size_type erase(const key_type& k); - void erase(const_iterator first, const_iterator last); - void clear(); - - void swap(hash_map&); - - hasher hash_funct() const; - key_equal key_eq() const; - - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - size_type count(const key_type& k) const; - pair<iterator, iterator> equal_range(const key_type& k); - pair<const_iterator, const_iterator> equal_range(const key_type& k) const; - - mapped_type& operator[](const key_type& k); - - size_type bucket_count() const; - size_type max_bucket_count() const; - - size_type elems_in_bucket(size_type n) const; - - void resize(size_type n); -}; - -template <class Key, class T, class Hash, class Pred, class Alloc> - void swap(hash_map<Key, T, Hash, Pred, Alloc>& x, - hash_map<Key, T, Hash, Pred, Alloc>& y); - -template <class Key, class T, class Hash, class Pred, class Alloc> - bool - operator==(const hash_map<Key, T, Hash, Pred, Alloc>& x, - const hash_map<Key, T, Hash, Pred, Alloc>& y); - -template <class Key, class T, class Hash, class Pred, class Alloc> - bool - operator!=(const hash_map<Key, T, Hash, Pred, Alloc>& x, - const hash_map<Key, T, Hash, Pred, Alloc>& y); - -template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>, - class Alloc = allocator<pair<const Key, T>>> -class hash_multimap -{ -public: - // types - typedef Key key_type; - typedef T mapped_type; - typedef Hash hasher; - typedef Pred key_equal; - typedef Alloc allocator_type; - typedef pair<const key_type, mapped_type> value_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef typename allocator_traits<allocator_type>::pointer pointer; - typedef typename allocator_traits<allocator_type>::const_pointer const_pointer; - typedef typename allocator_traits<allocator_type>::size_type size_type; - typedef typename allocator_traits<allocator_type>::difference_type difference_type; - - typedef /unspecified/ iterator; - typedef /unspecified/ const_iterator; - - explicit hash_multimap(size_type n = 193, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - template <class InputIterator> - hash_multimap(InputIterator f, InputIterator l, - size_type n = 193, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - explicit hash_multimap(const allocator_type&); - hash_multimap(const hash_multimap&); - ~hash_multimap(); - hash_multimap& operator=(const hash_multimap&); - - allocator_type get_allocator() const; - - bool empty() const; - size_type size() const; - size_type max_size() const; - - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - - iterator insert(const value_type& obj); - template <class InputIterator> - void insert(InputIterator first, InputIterator last); - - void erase(const_iterator position); - size_type erase(const key_type& k); - void erase(const_iterator first, const_iterator last); - void clear(); - - void swap(hash_multimap&); - - hasher hash_funct() const; - key_equal key_eq() const; - - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - size_type count(const key_type& k) const; - pair<iterator, iterator> equal_range(const key_type& k); - pair<const_iterator, const_iterator> equal_range(const key_type& k) const; - - size_type bucket_count() const; - size_type max_bucket_count() const; - - size_type elems_in_bucket(size_type n) const; - - void resize(size_type n); -}; - -template <class Key, class T, class Hash, class Pred, class Alloc> - void swap(hash_multimap<Key, T, Hash, Pred, Alloc>& x, - hash_multimap<Key, T, Hash, Pred, Alloc>& y); - -template <class Key, class T, class Hash, class Pred, class Alloc> - bool - operator==(const hash_multimap<Key, T, Hash, Pred, Alloc>& x, - const hash_multimap<Key, T, Hash, Pred, Alloc>& y); - -template <class Key, class T, class Hash, class Pred, class Alloc> - bool - operator!=(const hash_multimap<Key, T, Hash, Pred, Alloc>& x, - const hash_multimap<Key, T, Hash, Pred, Alloc>& y); - -} // __gnu_cxx - -*/ - -#include <__config> -#include <__hash_table> -#include <ext/__hash> -#include <functional> -#include <stdexcept> -#include <type_traits> - -#if defined(__DEPRECATED) && __DEPRECATED -#if defined(_LIBCPP_WARNING) - _LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map>") -#else -# warning Use of the header <ext/hash_map> is deprecated. Migrate to <unordered_map> -#endif -#endif - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -namespace __gnu_cxx { - -template <class _Tp, class _Hash, - bool = std::is_empty<_Hash>::value && !std::__libcpp_is_final<_Hash>::value - > -class __hash_map_hasher - : private _Hash -{ -public: - _LIBCPP_INLINE_VISIBILITY __hash_map_hasher() : _Hash() {} - _LIBCPP_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : _Hash(__h) {} - _LIBCPP_INLINE_VISIBILITY const _Hash& hash_function() const {return *this;} - _LIBCPP_INLINE_VISIBILITY - size_t operator()(const _Tp& __x) const - {return static_cast<const _Hash&>(*this)(__x.first);} - _LIBCPP_INLINE_VISIBILITY - size_t operator()(const typename _Tp::first_type& __x) const - {return static_cast<const _Hash&>(*this)(__x);} -}; - -template <class _Tp, class _Hash> -class __hash_map_hasher<_Tp, _Hash, false> -{ - _Hash __hash_; -public: - _LIBCPP_INLINE_VISIBILITY __hash_map_hasher() : __hash_() {} - _LIBCPP_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : __hash_(__h) {} - _LIBCPP_INLINE_VISIBILITY const _Hash& hash_function() const {return __hash_;} - _LIBCPP_INLINE_VISIBILITY - size_t operator()(const _Tp& __x) const - {return __hash_(__x.first);} - _LIBCPP_INLINE_VISIBILITY - size_t operator()(const typename _Tp::first_type& __x) const - {return __hash_(__x);} -}; - -template <class _Tp, class _Pred, - bool = std::is_empty<_Pred>::value && !std::__libcpp_is_final<_Pred>::value - > -class __hash_map_equal - : private _Pred -{ -public: - _LIBCPP_INLINE_VISIBILITY __hash_map_equal() : _Pred() {} - _LIBCPP_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : _Pred(__p) {} - _LIBCPP_INLINE_VISIBILITY const _Pred& key_eq() const {return *this;} - _LIBCPP_INLINE_VISIBILITY - bool operator()(const _Tp& __x, const _Tp& __y) const - {return static_cast<const _Pred&>(*this)(__x.first, __y.first);} - _LIBCPP_INLINE_VISIBILITY - bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const - {return static_cast<const _Pred&>(*this)(__x, __y.first);} - _LIBCPP_INLINE_VISIBILITY - bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const - {return static_cast<const _Pred&>(*this)(__x.first, __y);} - _LIBCPP_INLINE_VISIBILITY - bool operator()(const typename _Tp::first_type& __x, - const typename _Tp::first_type& __y) const - {return static_cast<const _Pred&>(*this)(__x, __y);} -}; - -template <class _Tp, class _Pred> -class __hash_map_equal<_Tp, _Pred, false> -{ - _Pred __pred_; -public: - _LIBCPP_INLINE_VISIBILITY __hash_map_equal() : __pred_() {} - _LIBCPP_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : __pred_(__p) {} - _LIBCPP_INLINE_VISIBILITY const _Pred& key_eq() const {return __pred_;} - _LIBCPP_INLINE_VISIBILITY - bool operator()(const _Tp& __x, const _Tp& __y) const - {return __pred_(__x.first, __y.first);} - _LIBCPP_INLINE_VISIBILITY - bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const - {return __pred_(__x, __y.first);} - _LIBCPP_INLINE_VISIBILITY - bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const - {return __pred_(__x.first, __y);} - _LIBCPP_INLINE_VISIBILITY - bool operator()(const typename _Tp::first_type& __x, - const typename _Tp::first_type& __y) const - {return __pred_(__x, __y);} -}; - -template <class _Alloc> -class __hash_map_node_destructor -{ - typedef _Alloc allocator_type; - typedef std::allocator_traits<allocator_type> __alloc_traits; - typedef typename __alloc_traits::value_type::__node_value_type value_type; -public: - typedef typename __alloc_traits::pointer pointer; -private: - typedef typename value_type::first_type first_type; - typedef typename value_type::second_type second_type; - - allocator_type& __na_; - -public: - bool __first_constructed; - bool __second_constructed; - - __hash_map_node_destructor(__hash_map_node_destructor const&) = default; - __hash_map_node_destructor& operator=(const __hash_map_node_destructor&) = delete; - - _LIBCPP_INLINE_VISIBILITY - explicit __hash_map_node_destructor(allocator_type& __na) - : __na_(__na), - __first_constructed(false), - __second_constructed(false) - {} - -#ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY - __hash_map_node_destructor(std::__hash_node_destructor<allocator_type>&& __x) - : __na_(__x.__na_), - __first_constructed(__x.__value_constructed), - __second_constructed(__x.__value_constructed) - { - __x.__value_constructed = false; - } -#else // _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY - __hash_map_node_destructor(const std::__hash_node_destructor<allocator_type>& __x) - : __na_(__x.__na_), - __first_constructed(__x.__value_constructed), - __second_constructed(__x.__value_constructed) - { - const_cast<bool&>(__x.__value_constructed) = false; - } -#endif // _LIBCPP_CXX03_LANG - - _LIBCPP_INLINE_VISIBILITY - void operator()(pointer __p) - { - if (__second_constructed) - __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second)); - if (__first_constructed) - __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first)); - if (__p) - __alloc_traits::deallocate(__na_, __p, 1); - } -}; - -template <class _HashIterator> -class _LIBCPP_TEMPLATE_VIS __hash_map_iterator -{ - _HashIterator __i_; - - typedef const typename _HashIterator::value_type::first_type key_type; - typedef typename _HashIterator::value_type::second_type mapped_type; -public: - typedef std::forward_iterator_tag iterator_category; - typedef std::pair<key_type, mapped_type> value_type; - typedef typename _HashIterator::difference_type difference_type; - typedef value_type& reference; - typedef typename std::__rebind_pointer<typename _HashIterator::pointer, value_type>::type - pointer; - - _LIBCPP_INLINE_VISIBILITY __hash_map_iterator() {} - - _LIBCPP_INLINE_VISIBILITY __hash_map_iterator(_HashIterator __i) : __i_(__i) {} - - _LIBCPP_INLINE_VISIBILITY reference operator*() const {return *operator->();} - _LIBCPP_INLINE_VISIBILITY pointer operator->() const {return (pointer)__i_.operator->();} - - _LIBCPP_INLINE_VISIBILITY __hash_map_iterator& operator++() {++__i_; return *this;} - _LIBCPP_INLINE_VISIBILITY - __hash_map_iterator operator++(int) - { - __hash_map_iterator __t(*this); - ++(*this); - return __t; - } - - friend _LIBCPP_INLINE_VISIBILITY - bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y) - {return __x.__i_ == __y.__i_;} - friend _LIBCPP_INLINE_VISIBILITY - bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y) - {return __x.__i_ != __y.__i_;} - - template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_map; - template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_multimap; - template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator; - template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator; - template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator; -}; - -template <class _HashIterator> -class _LIBCPP_TEMPLATE_VIS __hash_map_const_iterator -{ - _HashIterator __i_; - - typedef const typename _HashIterator::value_type::first_type key_type; - typedef typename _HashIterator::value_type::second_type mapped_type; -public: - typedef std::forward_iterator_tag iterator_category; - typedef std::pair<key_type, mapped_type> value_type; - typedef typename _HashIterator::difference_type difference_type; - typedef const value_type& reference; - typedef typename std::__rebind_pointer<typename _HashIterator::pointer, const value_type>::type - pointer; - - _LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {} - - _LIBCPP_INLINE_VISIBILITY - __hash_map_const_iterator(_HashIterator __i) : __i_(__i) {} - _LIBCPP_INLINE_VISIBILITY - __hash_map_const_iterator( - __hash_map_iterator<typename _HashIterator::__non_const_iterator> __i) - : __i_(__i.__i_) {} - - _LIBCPP_INLINE_VISIBILITY - reference operator*() const {return *operator->();} - _LIBCPP_INLINE_VISIBILITY - pointer operator->() const {return (pointer)__i_.operator->();} - - _LIBCPP_INLINE_VISIBILITY - __hash_map_const_iterator& operator++() {++__i_; return *this;} - _LIBCPP_INLINE_VISIBILITY - __hash_map_const_iterator operator++(int) - { - __hash_map_const_iterator __t(*this); - ++(*this); - return __t; - } - - friend _LIBCPP_INLINE_VISIBILITY - bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y) - {return __x.__i_ == __y.__i_;} - friend _LIBCPP_INLINE_VISIBILITY - bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y) - {return __x.__i_ != __y.__i_;} - - template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_map; - template <class, class, class, class, class> friend class _LIBCPP_TEMPLATE_VIS hash_multimap; - template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_iterator; - template <class> friend class _LIBCPP_TEMPLATE_VIS __hash_const_local_iterator; -}; - -template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = std::equal_to<_Key>, - class _Alloc = std::allocator<std::pair<const _Key, _Tp> > > -class _LIBCPP_TEMPLATE_VIS hash_map -{ -public: - // types - typedef _Key key_type; - typedef _Tp mapped_type; - typedef _Tp data_type; - typedef _Hash hasher; - typedef _Pred key_equal; - typedef _Alloc allocator_type; - typedef std::pair<const key_type, mapped_type> value_type; - typedef value_type& reference; - typedef const value_type& const_reference; - -private: - typedef std::pair<key_type, mapped_type> __value_type; - typedef __hash_map_hasher<__value_type, hasher> __hasher; - typedef __hash_map_equal<__value_type, key_equal> __key_equal; - typedef typename std::__rebind_alloc_helper< - std::allocator_traits<allocator_type>, __value_type>::type __allocator_type; - - typedef std::__hash_table<__value_type, __hasher, - __key_equal, __allocator_type> __table; - - __table __table_; - - typedef typename __table::__node_pointer __node_pointer; - typedef typename __table::__node_const_pointer __node_const_pointer; - typedef typename __table::__node_traits __node_traits; - typedef typename __table::__node_allocator __node_allocator; - typedef typename __table::__node __node; - typedef __hash_map_node_destructor<__node_allocator> _Dp; - typedef std::unique_ptr<__node, _Dp> __node_holder; - typedef std::allocator_traits<allocator_type> __alloc_traits; -public: - typedef typename __alloc_traits::pointer pointer; - typedef typename __alloc_traits::const_pointer const_pointer; - typedef typename __alloc_traits::size_type size_type; - typedef typename __alloc_traits::difference_type difference_type; - - typedef __hash_map_iterator<typename __table::iterator> iterator; - typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator; - - _LIBCPP_INLINE_VISIBILITY hash_map() { } - explicit hash_map(size_type __n, const hasher& __hf = hasher(), - const key_equal& __eql = key_equal()); - hash_map(size_type __n, const hasher& __hf, - const key_equal& __eql, - const allocator_type& __a); - template <class _InputIterator> - hash_map(_InputIterator __first, _InputIterator __last); - template <class _InputIterator> - hash_map(_InputIterator __first, _InputIterator __last, - size_type __n, const hasher& __hf = hasher(), - const key_equal& __eql = key_equal()); - template <class _InputIterator> - hash_map(_InputIterator __first, _InputIterator __last, - size_type __n, const hasher& __hf, - const key_equal& __eql, - const allocator_type& __a); - hash_map(const hash_map& __u); - - _LIBCPP_INLINE_VISIBILITY - allocator_type get_allocator() const - {return allocator_type(__table_.__node_alloc());} - - _LIBCPP_INLINE_VISIBILITY - bool empty() const {return __table_.size() == 0;} - _LIBCPP_INLINE_VISIBILITY - size_type size() const {return __table_.size();} - _LIBCPP_INLINE_VISIBILITY - size_type max_size() const {return __table_.max_size();} - - _LIBCPP_INLINE_VISIBILITY - iterator begin() {return __table_.begin();} - _LIBCPP_INLINE_VISIBILITY - iterator end() {return __table_.end();} - _LIBCPP_INLINE_VISIBILITY - const_iterator begin() const {return __table_.begin();} - _LIBCPP_INLINE_VISIBILITY - const_iterator end() const {return __table_.end();} - - _LIBCPP_INLINE_VISIBILITY - std::pair<iterator, bool> insert(const value_type& __x) - {return __table_.__insert_unique(__x);} - _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;} - template <class _InputIterator> - _LIBCPP_INLINE_VISIBILITY - void insert(_InputIterator __first, _InputIterator __last); - - _LIBCPP_INLINE_VISIBILITY - void erase(const_iterator __p) {__table_.erase(__p.__i_);} - _LIBCPP_INLINE_VISIBILITY - size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);} - _LIBCPP_INLINE_VISIBILITY - void erase(const_iterator __first, const_iterator __last) - {__table_.erase(__first.__i_, __last.__i_);} - _LIBCPP_INLINE_VISIBILITY - void clear() {__table_.clear();} - - _LIBCPP_INLINE_VISIBILITY - void swap(hash_map& __u) {__table_.swap(__u.__table_);} - - _LIBCPP_INLINE_VISIBILITY - hasher hash_funct() const - {return __table_.hash_function().hash_function();} - _LIBCPP_INLINE_VISIBILITY - key_equal key_eq() const - {return __table_.key_eq().key_eq();} - - _LIBCPP_INLINE_VISIBILITY - iterator find(const key_type& __k) {return __table_.find(__k);} - _LIBCPP_INLINE_VISIBILITY - const_iterator find(const key_type& __k) const {return __table_.find(__k);} - _LIBCPP_INLINE_VISIBILITY - size_type count(const key_type& __k) const {return __table_.__count_unique(__k);} - _LIBCPP_INLINE_VISIBILITY - std::pair<iterator, iterator> equal_range(const key_type& __k) - {return __table_.__equal_range_unique(__k);} - _LIBCPP_INLINE_VISIBILITY - std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const - {return __table_.__equal_range_unique(__k);} - - mapped_type& operator[](const key_type& __k); - - _LIBCPP_INLINE_VISIBILITY - size_type bucket_count() const {return __table_.bucket_count();} - _LIBCPP_INLINE_VISIBILITY - size_type max_bucket_count() const {return __table_.max_bucket_count();} - - _LIBCPP_INLINE_VISIBILITY - size_type elems_in_bucket(size_type __n) const - {return __table_.bucket_size(__n);} - - _LIBCPP_INLINE_VISIBILITY - void resize(size_type __n) {__table_.rehash(__n);} - -private: - __node_holder __construct_node(const key_type& __k); -}; - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map( - size_type __n, const hasher& __hf, const key_equal& __eql) - : __table_(__hf, __eql) -{ - __table_.rehash(__n); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map( - size_type __n, const hasher& __hf, const key_equal& __eql, - const allocator_type& __a) - : __table_(__hf, __eql, __a) -{ - __table_.rehash(__n); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map( - _InputIterator __first, _InputIterator __last) -{ - insert(__first, __last); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map( - _InputIterator __first, _InputIterator __last, size_type __n, - const hasher& __hf, const key_equal& __eql) - : __table_(__hf, __eql) -{ - __table_.rehash(__n); - insert(__first, __last); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map( - _InputIterator __first, _InputIterator __last, size_type __n, - const hasher& __hf, const key_equal& __eql, const allocator_type& __a) - : __table_(__hf, __eql, __a) -{ - __table_.rehash(__n); - insert(__first, __last); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_map( - const hash_map& __u) - : __table_(__u.__table_) -{ - __table_.rehash(__u.bucket_count()); - insert(__u.begin(), __u.end()); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -typename hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder -hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& __k) -{ - __node_allocator& __na = __table_.__node_alloc(); - __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na)); - __node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), __k); - __h.get_deleter().__first_constructed = true; - __node_traits::construct(__na, _VSTD::addressof(__h->__value_.second)); - __h.get_deleter().__second_constructed = true; - return __h; -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -inline -void -hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, - _InputIterator __last) -{ - for (; __first != __last; ++__first) - __table_.__insert_unique(*__first); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -_Tp& -hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k) -{ - iterator __i = find(__k); - if (__i != end()) - return __i->second; - __node_holder __h = __construct_node(__k); - std::pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get()); - __h.release(); - return __r.first->second; -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -void -swap(hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, - hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) -{ - __x.swap(__y); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -bool -operator==(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, - const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) -{ - if (__x.size() != __y.size()) - return false; - typedef typename hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::const_iterator - const_iterator; - for (const_iterator __i = __x.begin(), __ex = __x.end(), __ey = __y.end(); - __i != __ex; ++__i) - { - const_iterator __j = __y.find(__i->first); - if (__j == __ey || !(*__i == *__j)) - return false; - } - return true; -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, - const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) -{ - return !(__x == __y); -} - -template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = std::equal_to<_Key>, - class _Alloc = std::allocator<std::pair<const _Key, _Tp> > > -class _LIBCPP_TEMPLATE_VIS hash_multimap -{ -public: - // types - typedef _Key key_type; - typedef _Tp mapped_type; - typedef _Tp data_type; - typedef _Hash hasher; - typedef _Pred key_equal; - typedef _Alloc allocator_type; - typedef std::pair<const key_type, mapped_type> value_type; - typedef value_type& reference; - typedef const value_type& const_reference; - -private: - typedef std::pair<key_type, mapped_type> __value_type; - typedef __hash_map_hasher<__value_type, hasher> __hasher; - typedef __hash_map_equal<__value_type, key_equal> __key_equal; - typedef typename std::__rebind_alloc_helper<std::allocator_traits<allocator_type>, __value_type>::type __allocator_type; - - typedef std::__hash_table<__value_type, __hasher, - __key_equal, __allocator_type> __table; - - __table __table_; - - typedef typename __table::__node_traits __node_traits; - typedef typename __table::__node_allocator __node_allocator; - typedef typename __table::__node __node; - typedef __hash_map_node_destructor<__node_allocator> _Dp; - typedef std::unique_ptr<__node, _Dp> __node_holder; - typedef std::allocator_traits<allocator_type> __alloc_traits; -public: - typedef typename __alloc_traits::pointer pointer; - typedef typename __alloc_traits::const_pointer const_pointer; - typedef typename __alloc_traits::size_type size_type; - typedef typename __alloc_traits::difference_type difference_type; - - typedef __hash_map_iterator<typename __table::iterator> iterator; - typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator; - - _LIBCPP_INLINE_VISIBILITY - hash_multimap() { } - explicit hash_multimap(size_type __n, const hasher& __hf = hasher(), - const key_equal& __eql = key_equal()); - hash_multimap(size_type __n, const hasher& __hf, - const key_equal& __eql, - const allocator_type& __a); - template <class _InputIterator> - hash_multimap(_InputIterator __first, _InputIterator __last); - template <class _InputIterator> - hash_multimap(_InputIterator __first, _InputIterator __last, - size_type __n, const hasher& __hf = hasher(), - const key_equal& __eql = key_equal()); - template <class _InputIterator> - hash_multimap(_InputIterator __first, _InputIterator __last, - size_type __n, const hasher& __hf, - const key_equal& __eql, - const allocator_type& __a); - hash_multimap(const hash_multimap& __u); - - _LIBCPP_INLINE_VISIBILITY - allocator_type get_allocator() const - {return allocator_type(__table_.__node_alloc());} - - _LIBCPP_INLINE_VISIBILITY - bool empty() const {return __table_.size() == 0;} - _LIBCPP_INLINE_VISIBILITY - size_type size() const {return __table_.size();} - _LIBCPP_INLINE_VISIBILITY - size_type max_size() const {return __table_.max_size();} - - _LIBCPP_INLINE_VISIBILITY - iterator begin() {return __table_.begin();} - _LIBCPP_INLINE_VISIBILITY - iterator end() {return __table_.end();} - _LIBCPP_INLINE_VISIBILITY - const_iterator begin() const {return __table_.begin();} - _LIBCPP_INLINE_VISIBILITY - const_iterator end() const {return __table_.end();} - - _LIBCPP_INLINE_VISIBILITY - iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);} - _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator, const value_type& __x) {return insert(__x);} - template <class _InputIterator> - _LIBCPP_INLINE_VISIBILITY - void insert(_InputIterator __first, _InputIterator __last); - - _LIBCPP_INLINE_VISIBILITY - void erase(const_iterator __p) {__table_.erase(__p.__i_);} - _LIBCPP_INLINE_VISIBILITY - size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);} - _LIBCPP_INLINE_VISIBILITY - void erase(const_iterator __first, const_iterator __last) - {__table_.erase(__first.__i_, __last.__i_);} - _LIBCPP_INLINE_VISIBILITY - void clear() {__table_.clear();} - - _LIBCPP_INLINE_VISIBILITY - void swap(hash_multimap& __u) {__table_.swap(__u.__table_);} - - _LIBCPP_INLINE_VISIBILITY - hasher hash_funct() const - {return __table_.hash_function().hash_function();} - _LIBCPP_INLINE_VISIBILITY - key_equal key_eq() const - {return __table_.key_eq().key_eq();} - - _LIBCPP_INLINE_VISIBILITY - iterator find(const key_type& __k) {return __table_.find(__k);} - _LIBCPP_INLINE_VISIBILITY - const_iterator find(const key_type& __k) const {return __table_.find(__k);} - _LIBCPP_INLINE_VISIBILITY - size_type count(const key_type& __k) const {return __table_.__count_multi(__k);} - _LIBCPP_INLINE_VISIBILITY - std::pair<iterator, iterator> equal_range(const key_type& __k) - {return __table_.__equal_range_multi(__k);} - _LIBCPP_INLINE_VISIBILITY - std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const - {return __table_.__equal_range_multi(__k);} - - _LIBCPP_INLINE_VISIBILITY - size_type bucket_count() const {return __table_.bucket_count();} - _LIBCPP_INLINE_VISIBILITY - size_type max_bucket_count() const {return __table_.max_bucket_count();} - - _LIBCPP_INLINE_VISIBILITY - size_type elems_in_bucket(size_type __n) const - {return __table_.bucket_size(__n);} - - _LIBCPP_INLINE_VISIBILITY - void resize(size_type __n) {__table_.rehash(__n);} -}; - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap( - size_type __n, const hasher& __hf, const key_equal& __eql) - : __table_(__hf, __eql) -{ - __table_.rehash(__n); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap( - size_type __n, const hasher& __hf, const key_equal& __eql, - const allocator_type& __a) - : __table_(__hf, __eql, __a) -{ - __table_.rehash(__n); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap( - _InputIterator __first, _InputIterator __last) -{ - insert(__first, __last); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap( - _InputIterator __first, _InputIterator __last, size_type __n, - const hasher& __hf, const key_equal& __eql) - : __table_(__hf, __eql) -{ - __table_.rehash(__n); - insert(__first, __last); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap( - _InputIterator __first, _InputIterator __last, size_type __n, - const hasher& __hf, const key_equal& __eql, const allocator_type& __a) - : __table_(__hf, __eql, __a) -{ - __table_.rehash(__n); - insert(__first, __last); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::hash_multimap( - const hash_multimap& __u) - : __table_(__u.__table_) -{ - __table_.rehash(__u.bucket_count()); - insert(__u.begin(), __u.end()); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -inline -void -hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, - _InputIterator __last) -{ - for (; __first != __last; ++__first) - __table_.__insert_multi(*__first); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -void -swap(hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, - hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) -{ - __x.swap(__y); -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -bool -operator==(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, - const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) -{ - if (__x.size() != __y.size()) - return false; - typedef typename hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::const_iterator - const_iterator; - typedef std::pair<const_iterator, const_iterator> _EqRng; - for (const_iterator __i = __x.begin(), __ex = __x.end(); __i != __ex;) - { - _EqRng __xeq = __x.equal_range(__i->first); - _EqRng __yeq = __y.equal_range(__i->first); - if (_VSTD::distance(__xeq.first, __xeq.second) != - _VSTD::distance(__yeq.first, __yeq.second) || - !_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first)) - return false; - __i = __xeq.second; - } - return true; -} - -template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator!=(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, - const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) -{ - return !(__x == __y); -} - -} // namespace __gnu_cxx - -#endif // _LIBCPP_HASH_MAP diff --git a/contrib/libs/cxxsupp/libcxx/include/ext/hash_set b/contrib/libs/cxxsupp/libcxx/include/ext/hash_set deleted file mode 100644 index 254f482a5ae..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/ext/hash_set +++ /dev/null @@ -1,663 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_HASH_SET -#define _LIBCPP_HASH_SET - -/* - - hash_set synopsis - -namespace __gnu_cxx -{ - -template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, - class Alloc = allocator<Value>> -class hash_set -{ -public: - // types - typedef Value key_type; - typedef key_type value_type; - typedef Hash hasher; - typedef Pred key_equal; - typedef Alloc allocator_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef typename allocator_traits<allocator_type>::pointer pointer; - typedef typename allocator_traits<allocator_type>::const_pointer const_pointer; - typedef typename allocator_traits<allocator_type>::size_type size_type; - typedef typename allocator_traits<allocator_type>::difference_type difference_type; - - typedef /unspecified/ iterator; - typedef /unspecified/ const_iterator; - - explicit hash_set(size_type n = 193, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - template <class InputIterator> - hash_set(InputIterator f, InputIterator l, - size_type n = 193, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - hash_set(const hash_set&); - ~hash_set(); - hash_set& operator=(const hash_set&); - - allocator_type get_allocator() const; - - bool empty() const; - size_type size() const; - size_type max_size() const; - - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - - pair<iterator, bool> insert(const value_type& obj); - template <class InputIterator> - void insert(InputIterator first, InputIterator last); - - void erase(const_iterator position); - size_type erase(const key_type& k); - void erase(const_iterator first, const_iterator last); - void clear(); - - void swap(hash_set&); - - hasher hash_funct() const; - key_equal key_eq() const; - - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - size_type count(const key_type& k) const; - pair<iterator, iterator> equal_range(const key_type& k); - pair<const_iterator, const_iterator> equal_range(const key_type& k) const; - - size_type bucket_count() const; - size_type max_bucket_count() const; - - size_type elems_in_bucket(size_type n) const; - - void resize(size_type n); -}; - -template <class Value, class Hash, class Pred, class Alloc> - void swap(hash_set<Value, Hash, Pred, Alloc>& x, - hash_set<Value, Hash, Pred, Alloc>& y); - -template <class Value, class Hash, class Pred, class Alloc> - bool - operator==(const hash_set<Value, Hash, Pred, Alloc>& x, - const hash_set<Value, Hash, Pred, Alloc>& y); - -template <class Value, class Hash, class Pred, class Alloc> - bool - operator!=(const hash_set<Value, Hash, Pred, Alloc>& x, - const hash_set<Value, Hash, Pred, Alloc>& y); - -template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, - class Alloc = allocator<Value>> -class hash_multiset -{ -public: - // types - typedef Value key_type; - typedef key_type value_type; - typedef Hash hasher; - typedef Pred key_equal; - typedef Alloc allocator_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef typename allocator_traits<allocator_type>::pointer pointer; - typedef typename allocator_traits<allocator_type>::const_pointer const_pointer; - typedef typename allocator_traits<allocator_type>::size_type size_type; - typedef typename allocator_traits<allocator_type>::difference_type difference_type; - - typedef /unspecified/ iterator; - typedef /unspecified/ const_iterator; - - explicit hash_multiset(size_type n = 193, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - template <class InputIterator> - hash_multiset(InputIterator f, InputIterator l, - size_type n = 193, const hasher& hf = hasher(), - const key_equal& eql = key_equal(), - const allocator_type& a = allocator_type()); - hash_multiset(const hash_multiset&); - ~hash_multiset(); - hash_multiset& operator=(const hash_multiset&); - - allocator_type get_allocator() const; - - bool empty() const; - size_type size() const; - size_type max_size() const; - - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - - iterator insert(const value_type& obj); - template <class InputIterator> - void insert(InputIterator first, InputIterator last); - - void erase(const_iterator position); - size_type erase(const key_type& k); - void erase(const_iterator first, const_iterator last); - void clear(); - - void swap(hash_multiset&); - - hasher hash_funct() const; - key_equal key_eq() const; - - iterator find(const key_type& k); - const_iterator find(const key_type& k) const; - size_type count(const key_type& k) const; - pair<iterator, iterator> equal_range(const key_type& k); - pair<const_iterator, const_iterator> equal_range(const key_type& k) const; - - size_type bucket_count() const; - size_type max_bucket_count() const; - - size_type elems_in_bucket(size_type n) const; - - void resize(size_type n); -}; - -template <class Value, class Hash, class Pred, class Alloc> - void swap(hash_multiset<Value, Hash, Pred, Alloc>& x, - hash_multiset<Value, Hash, Pred, Alloc>& y); - -template <class Value, class Hash, class Pred, class Alloc> - bool - operator==(const hash_multiset<Value, Hash, Pred, Alloc>& x, - const hash_multiset<Value, Hash, Pred, Alloc>& y); - -template <class Value, class Hash, class Pred, class Alloc> - bool - operator!=(const hash_multiset<Value, Hash, Pred, Alloc>& x, - const hash_multiset<Value, Hash, Pred, Alloc>& y); -} // __gnu_cxx - -*/ - -#include <__config> -#include <__hash_table> -#include <ext/__hash> -#include <functional> - -#if defined(__DEPRECATED) && __DEPRECATED -#if defined(_LIBCPP_WARNING) - _LIBCPP_WARNING("Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set>") -#else -# warning Use of the header <ext/hash_set> is deprecated. Migrate to <unordered_set> -#endif -#endif - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -namespace __gnu_cxx { - - -template <class _Value, class _Hash = hash<_Value>, class _Pred = std::equal_to<_Value>, - class _Alloc = std::allocator<_Value> > -class _LIBCPP_TEMPLATE_VIS hash_set -{ -public: - // types - typedef _Value key_type; - typedef key_type value_type; - typedef _Hash hasher; - typedef _Pred key_equal; - typedef _Alloc allocator_type; - typedef value_type& reference; - typedef const value_type& const_reference; - -private: - typedef std::__hash_table<value_type, hasher, key_equal, allocator_type> __table; - - __table __table_; - -public: - typedef typename __table::pointer pointer; - typedef typename __table::const_pointer const_pointer; - typedef typename __table::size_type size_type; - typedef typename __table::difference_type difference_type; - - typedef typename __table::const_iterator iterator; - typedef typename __table::const_iterator const_iterator; - - _LIBCPP_INLINE_VISIBILITY - hash_set() { } - explicit hash_set(size_type __n, const hasher& __hf = hasher(), - const key_equal& __eql = key_equal()); - hash_set(size_type __n, const hasher& __hf, const key_equal& __eql, - const allocator_type& __a); - template <class _InputIterator> - hash_set(_InputIterator __first, _InputIterator __last); - template <class _InputIterator> - hash_set(_InputIterator __first, _InputIterator __last, - size_type __n, const hasher& __hf = hasher(), - const key_equal& __eql = key_equal()); - template <class _InputIterator> - hash_set(_InputIterator __first, _InputIterator __last, - size_type __n, const hasher& __hf, const key_equal& __eql, - const allocator_type& __a); - hash_set(const hash_set& __u); - - _LIBCPP_INLINE_VISIBILITY - allocator_type get_allocator() const - {return allocator_type(__table_.__node_alloc());} - - _LIBCPP_INLINE_VISIBILITY - bool empty() const {return __table_.size() == 0;} - _LIBCPP_INLINE_VISIBILITY - size_type size() const {return __table_.size();} - _LIBCPP_INLINE_VISIBILITY - size_type max_size() const {return __table_.max_size();} - - _LIBCPP_INLINE_VISIBILITY - iterator begin() {return __table_.begin();} - _LIBCPP_INLINE_VISIBILITY - iterator end() {return __table_.end();} - _LIBCPP_INLINE_VISIBILITY - const_iterator begin() const {return __table_.begin();} - _LIBCPP_INLINE_VISIBILITY - const_iterator end() const {return __table_.end();} - - _LIBCPP_INLINE_VISIBILITY - std::pair<iterator, bool> insert(const value_type& __x) - {return __table_.__insert_unique(__x);} - _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator, const value_type& __x) {return insert(__x).first;} - template <class _InputIterator> - _LIBCPP_INLINE_VISIBILITY - void insert(_InputIterator __first, _InputIterator __last); - - _LIBCPP_INLINE_VISIBILITY - void erase(const_iterator __p) {__table_.erase(__p);} - _LIBCPP_INLINE_VISIBILITY - size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);} - _LIBCPP_INLINE_VISIBILITY - void erase(const_iterator __first, const_iterator __last) - {__table_.erase(__first, __last);} - _LIBCPP_INLINE_VISIBILITY - void clear() {__table_.clear();} - - _LIBCPP_INLINE_VISIBILITY - void swap(hash_set& __u) {__table_.swap(__u.__table_);} - - _LIBCPP_INLINE_VISIBILITY - hasher hash_funct() const {return __table_.hash_function();} - _LIBCPP_INLINE_VISIBILITY - key_equal key_eq() const {return __table_.key_eq();} - - _LIBCPP_INLINE_VISIBILITY - iterator find(const key_type& __k) {return __table_.find(__k);} - _LIBCPP_INLINE_VISIBILITY - const_iterator find(const key_type& __k) const {return __table_.find(__k);} - _LIBCPP_INLINE_VISIBILITY - size_type count(const key_type& __k) const {return __table_.__count_unique(__k);} - _LIBCPP_INLINE_VISIBILITY - std::pair<iterator, iterator> equal_range(const key_type& __k) - {return __table_.__equal_range_unique(__k);} - _LIBCPP_INLINE_VISIBILITY - std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const - {return __table_.__equal_range_unique(__k);} - - _LIBCPP_INLINE_VISIBILITY - size_type bucket_count() const {return __table_.bucket_count();} - _LIBCPP_INLINE_VISIBILITY - size_type max_bucket_count() const {return __table_.max_bucket_count();} - - _LIBCPP_INLINE_VISIBILITY - size_type elems_in_bucket(size_type __n) const {return __table_.bucket_size(__n);} - - _LIBCPP_INLINE_VISIBILITY - void resize(size_type __n) {__table_.rehash(__n);} -}; - -template <class _Value, class _Hash, class _Pred, class _Alloc> -hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(size_type __n, - const hasher& __hf, const key_equal& __eql) - : __table_(__hf, __eql) -{ - __table_.rehash(__n); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set(size_type __n, - const hasher& __hf, const key_equal& __eql, const allocator_type& __a) - : __table_(__hf, __eql, __a) -{ - __table_.rehash(__n); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set( - _InputIterator __first, _InputIterator __last) -{ - insert(__first, __last); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set( - _InputIterator __first, _InputIterator __last, size_type __n, - const hasher& __hf, const key_equal& __eql) - : __table_(__hf, __eql) -{ - __table_.rehash(__n); - insert(__first, __last); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set( - _InputIterator __first, _InputIterator __last, size_type __n, - const hasher& __hf, const key_equal& __eql, const allocator_type& __a) - : __table_(__hf, __eql, __a) -{ - __table_.rehash(__n); - insert(__first, __last); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -hash_set<_Value, _Hash, _Pred, _Alloc>::hash_set( - const hash_set& __u) - : __table_(__u.__table_) -{ - __table_.rehash(__u.bucket_count()); - insert(__u.begin(), __u.end()); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -inline -void -hash_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, - _InputIterator __last) -{ - for (; __first != __last; ++__first) - __table_.__insert_unique(*__first); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -void -swap(hash_set<_Value, _Hash, _Pred, _Alloc>& __x, - hash_set<_Value, _Hash, _Pred, _Alloc>& __y) -{ - __x.swap(__y); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -bool -operator==(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x, - const hash_set<_Value, _Hash, _Pred, _Alloc>& __y) -{ - if (__x.size() != __y.size()) - return false; - typedef typename hash_set<_Value, _Hash, _Pred, _Alloc>::const_iterator - const_iterator; - for (const_iterator __i = __x.begin(), __ex = __x.end(), __ey = __y.end(); - __i != __ex; ++__i) - { - const_iterator __j = __y.find(*__i); - if (__j == __ey || !(*__i == *__j)) - return false; - } - return true; -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator!=(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x, - const hash_set<_Value, _Hash, _Pred, _Alloc>& __y) -{ - return !(__x == __y); -} - -template <class _Value, class _Hash = hash<_Value>, class _Pred = std::equal_to<_Value>, - class _Alloc = std::allocator<_Value> > -class _LIBCPP_TEMPLATE_VIS hash_multiset -{ -public: - // types - typedef _Value key_type; - typedef key_type value_type; - typedef _Hash hasher; - typedef _Pred key_equal; - typedef _Alloc allocator_type; - typedef value_type& reference; - typedef const value_type& const_reference; - -private: - typedef std::__hash_table<value_type, hasher, key_equal, allocator_type> __table; - - __table __table_; - -public: - typedef typename __table::pointer pointer; - typedef typename __table::const_pointer const_pointer; - typedef typename __table::size_type size_type; - typedef typename __table::difference_type difference_type; - - typedef typename __table::const_iterator iterator; - typedef typename __table::const_iterator const_iterator; - - _LIBCPP_INLINE_VISIBILITY - hash_multiset() { } - explicit hash_multiset(size_type __n, const hasher& __hf = hasher(), - const key_equal& __eql = key_equal()); - hash_multiset(size_type __n, const hasher& __hf, - const key_equal& __eql, const allocator_type& __a); - template <class _InputIterator> - hash_multiset(_InputIterator __first, _InputIterator __last); - template <class _InputIterator> - hash_multiset(_InputIterator __first, _InputIterator __last, - size_type __n, const hasher& __hf = hasher(), - const key_equal& __eql = key_equal()); - template <class _InputIterator> - hash_multiset(_InputIterator __first, _InputIterator __last, - size_type __n , const hasher& __hf, - const key_equal& __eql, const allocator_type& __a); - hash_multiset(const hash_multiset& __u); - - _LIBCPP_INLINE_VISIBILITY - allocator_type get_allocator() const - {return allocator_type(__table_.__node_alloc());} - - _LIBCPP_INLINE_VISIBILITY - bool empty() const {return __table_.size() == 0;} - _LIBCPP_INLINE_VISIBILITY - size_type size() const {return __table_.size();} - _LIBCPP_INLINE_VISIBILITY - size_type max_size() const {return __table_.max_size();} - - _LIBCPP_INLINE_VISIBILITY - iterator begin() {return __table_.begin();} - _LIBCPP_INLINE_VISIBILITY - iterator end() {return __table_.end();} - _LIBCPP_INLINE_VISIBILITY - const_iterator begin() const {return __table_.begin();} - _LIBCPP_INLINE_VISIBILITY - const_iterator end() const {return __table_.end();} - - _LIBCPP_INLINE_VISIBILITY - iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);} - _LIBCPP_INLINE_VISIBILITY - iterator insert(const_iterator, const value_type& __x) {return insert(__x);} - template <class _InputIterator> - _LIBCPP_INLINE_VISIBILITY - void insert(_InputIterator __first, _InputIterator __last); - - _LIBCPP_INLINE_VISIBILITY - void erase(const_iterator __p) {__table_.erase(__p);} - _LIBCPP_INLINE_VISIBILITY - size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);} - _LIBCPP_INLINE_VISIBILITY - void erase(const_iterator __first, const_iterator __last) - {__table_.erase(__first, __last);} - _LIBCPP_INLINE_VISIBILITY - void clear() {__table_.clear();} - - _LIBCPP_INLINE_VISIBILITY - void swap(hash_multiset& __u) {__table_.swap(__u.__table_);} - - _LIBCPP_INLINE_VISIBILITY - hasher hash_funct() const {return __table_.hash_function();} - _LIBCPP_INLINE_VISIBILITY - key_equal key_eq() const {return __table_.key_eq();} - - _LIBCPP_INLINE_VISIBILITY - iterator find(const key_type& __k) {return __table_.find(__k);} - _LIBCPP_INLINE_VISIBILITY - const_iterator find(const key_type& __k) const {return __table_.find(__k);} - _LIBCPP_INLINE_VISIBILITY - size_type count(const key_type& __k) const {return __table_.__count_multi(__k);} - _LIBCPP_INLINE_VISIBILITY - std::pair<iterator, iterator> equal_range(const key_type& __k) - {return __table_.__equal_range_multi(__k);} - _LIBCPP_INLINE_VISIBILITY - std::pair<const_iterator, const_iterator> equal_range(const key_type& __k) const - {return __table_.__equal_range_multi(__k);} - - _LIBCPP_INLINE_VISIBILITY - size_type bucket_count() const {return __table_.bucket_count();} - _LIBCPP_INLINE_VISIBILITY - size_type max_bucket_count() const {return __table_.max_bucket_count();} - - _LIBCPP_INLINE_VISIBILITY - size_type elems_in_bucket(size_type __n) const {return __table_.bucket_size(__n);} - - _LIBCPP_INLINE_VISIBILITY - void resize(size_type __n) {__table_.rehash(__n);} -}; - -template <class _Value, class _Hash, class _Pred, class _Alloc> -hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset( - size_type __n, const hasher& __hf, const key_equal& __eql) - : __table_(__hf, __eql) -{ - __table_.rehash(__n); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset( - size_type __n, const hasher& __hf, const key_equal& __eql, - const allocator_type& __a) - : __table_(__hf, __eql, __a) -{ - __table_.rehash(__n); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset( - _InputIterator __first, _InputIterator __last) -{ - insert(__first, __last); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset( - _InputIterator __first, _InputIterator __last, size_type __n, - const hasher& __hf, const key_equal& __eql) - : __table_(__hf, __eql) -{ - __table_.rehash(__n); - insert(__first, __last); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset( - _InputIterator __first, _InputIterator __last, size_type __n, - const hasher& __hf, const key_equal& __eql, const allocator_type& __a) - : __table_(__hf, __eql, __a) -{ - __table_.rehash(__n); - insert(__first, __last); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -hash_multiset<_Value, _Hash, _Pred, _Alloc>::hash_multiset( - const hash_multiset& __u) - : __table_(__u.__table_) -{ - __table_.rehash(__u.bucket_count()); - insert(__u.begin(), __u.end()); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -template <class _InputIterator> -inline -void -hash_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first, - _InputIterator __last) -{ - for (; __first != __last; ++__first) - __table_.__insert_multi(*__first); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -void -swap(hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x, - hash_multiset<_Value, _Hash, _Pred, _Alloc>& __y) -{ - __x.swap(__y); -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -bool -operator==(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x, - const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __y) -{ - if (__x.size() != __y.size()) - return false; - typedef typename hash_multiset<_Value, _Hash, _Pred, _Alloc>::const_iterator - const_iterator; - typedef std::pair<const_iterator, const_iterator> _EqRng; - for (const_iterator __i = __x.begin(), __ex = __x.end(); __i != __ex;) - { - _EqRng __xeq = __x.equal_range(*__i); - _EqRng __yeq = __y.equal_range(*__i); - if (_VSTD::distance(__xeq.first, __xeq.second) != - _VSTD::distance(__yeq.first, __yeq.second) || - !_VSTD::is_permutation(__xeq.first, __xeq.second, __yeq.first)) - return false; - __i = __xeq.second; - } - return true; -} - -template <class _Value, class _Hash, class _Pred, class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator!=(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x, - const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __y) -{ - return !(__x == __y); -} - -} // namespace __gnu_cxx - -#endif // _LIBCPP_HASH_SET diff --git a/contrib/libs/cxxsupp/libcxx/include/latch b/contrib/libs/cxxsupp/libcxx/include/latch deleted file mode 100644 index e1e15190ae4..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/latch +++ /dev/null @@ -1,113 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_LATCH -#define _LIBCPP_LATCH - -/* - latch synopsis - -namespace std -{ - - class latch - { - public: - static constexpr ptrdiff_t max() noexcept; - - constexpr explicit latch(ptrdiff_t __expected); - ~latch(); - - latch(const latch&) = delete; - latch& operator=(const latch&) = delete; - - void count_down(ptrdiff_t __update = 1); - bool try_wait() const noexcept; - void wait() const; - void arrive_and_wait(ptrdiff_t __update = 1); - - private: - ptrdiff_t __counter; // exposition only - }; - -} - -*/ - -#include <__availability> -#include <__config> -#include <atomic> -#include <version> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#ifdef _LIBCPP_HAS_NO_THREADS -# error <latch> is not supported on this single threaded system -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if _LIBCPP_STD_VER >= 14 - -_LIBCPP_BEGIN_NAMESPACE_STD - -class latch -{ - __atomic_base<ptrdiff_t> __a; - -public: - static constexpr ptrdiff_t max() noexcept { - return numeric_limits<ptrdiff_t>::max(); - } - - inline _LIBCPP_INLINE_VISIBILITY - constexpr explicit latch(ptrdiff_t __expected) : __a(__expected) { } - - ~latch() = default; - latch(const latch&) = delete; - latch& operator=(const latch&) = delete; - - inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - void count_down(ptrdiff_t __update = 1) - { - auto const __old = __a.fetch_sub(__update, memory_order_release); - if(__old == __update) - __a.notify_all(); - } - inline _LIBCPP_INLINE_VISIBILITY - bool try_wait() const noexcept - { - return 0 == __a.load(memory_order_acquire); - } - inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - void wait() const - { - auto const __test_fn = [=]() -> bool { - return try_wait(); - }; - __cxx_atomic_wait(&__a.__a_, __test_fn); - } - inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - void arrive_and_wait(ptrdiff_t __update = 1) - { - count_down(__update); - wait(); - } -}; - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_STD_VER >= 14 - -_LIBCPP_POP_MACROS - -#endif //_LIBCPP_LATCH diff --git a/contrib/libs/cxxsupp/libcxx/include/module.modulemap b/contrib/libs/cxxsupp/libcxx/include/module.modulemap deleted file mode 100644 index b9587376451..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/module.modulemap +++ /dev/null @@ -1,1104 +0,0 @@ -// define the module for __config outside of the top level 'std' module -// since __config may be included from C headers which may create an -// include cycle. -module std_config [system] [extern_c] { - header "__config" - header "__config_site" - export * -} - -module std [system] { - export std_config - // FIXME: The standard does not require that each of these submodules - // re-exports its imported modules. We should provide an alternative form of - // export that issues a warning if a name from the submodule is used, and - // use that to provide a 'strict mode' for libc++. - - // Deprecated C-compatibility headers. These can all be included from within - // an 'extern "C"' context. - module depr [extern_c] { - // <assert.h> provided by C library. - module ctype_h { - header "ctype.h" - export * - } - module errno_h { - header "errno.h" - export * - } - module fenv_h { - header "fenv.h" - export * - } - // <float.h> provided by compiler or C library. - module inttypes_h { - header "inttypes.h" - export stdint_h - export * - } - // <iso646.h> provided by compiler. - // <limits.h> provided by compiler or C library. - module locale_h { - header "locale.h" - export * - } - module math_h { - header "math.h" - export * - } - module setjmp_h { - header "setjmp.h" - export * - } - module stdatomic_h { - header "stdatomic.h" - export * - } - // FIXME: <stdalign.h> is missing. - // <signal.h> provided by C library. - // <stdarg.h> provided by compiler. - // <stdbool.h> provided by compiler. - module stddef_h { - // <stddef.h>'s __need_* macros require textual inclusion. - textual header "stddef.h" - } - module stdint_h { - header "stdint.h" - export * - // FIXME: This module only exists on OS X and for some reason the - // wildcard above doesn't export it. - export Darwin.C.stdint - } - module stdio_h { - // <stdio.h>'s __need_* macros require textual inclusion. - textual header "stdio.h" - export * - export Darwin.C.stdio - } - module stdlib_h { - // <stdlib.h>'s __need_* macros require textual inclusion. - textual header "stdlib.h" - export * - } - module string_h { - header "string.h" - export * - } - // FIXME: <uchar.h> is missing. - // <time.h> provided by C library. - module wchar_h { - // <wchar.h>'s __need_* macros require textual inclusion. - textual header "wchar.h" - export * - } - module wctype_h { - header "wctype.h" - export * - } - } - - // <complex.h> and <tgmath.h> are not C headers in any real sense, do not - // allow their use in extern "C" contexts. - module complex_h { - header "complex.h" - export ccomplex - export * - } - module tgmath_h { - header "tgmath.h" - export ccomplex - export cmath - export * - } - - // C compatibility headers. - module compat { - module cassert { - // <cassert>'s use of NDEBUG requires textual inclusion. - textual header "cassert" - } - module ccomplex { - header "ccomplex" - export complex - export * - } - module cctype { - header "cctype" - export * - } - module cerrno { - header "cerrno" - export * - } - module cfenv { - header "cfenv" - export * - } - module cfloat { - header "cfloat" - export * - } - module cinttypes { - header "cinttypes" - export cstdint - export * - } - module ciso646 { - header "ciso646" - export * - } - module climits { - header "climits" - export * - } - module clocale { - header "clocale" - export * - } - module cmath { - header "cmath" - export * - } - module csetjmp { - header "csetjmp" - export * - } - module csignal { - header "csignal" - export * - } - // FIXME: <cstdalign> is missing. - module cstdarg { - header "cstdarg" - export * - } - module cstdbool { - header "cstdbool" - export * - } - module cstddef { - header "cstddef" - export * - } - module cstdint { - header "cstdint" - export depr.stdint_h - export * - } - module cstdio { - header "cstdio" - export * - } - module cstdlib { - header "cstdlib" - export * - } - module cstring { - header "cstring" - export * - } - module ctgmath { - header "ctgmath" - export ccomplex - export cmath - export * - } - module ctime { - header "ctime" - export * - } - // FIXME: <cuchar> is missing. - module cwchar { - header "cwchar" - export depr.stdio_h - export * - } - module cwctype { - header "cwctype" - export * - } - } - - module algorithm { - header "algorithm" - export initializer_list - export * - - module __algorithm { - module adjacent_find { private header "__algorithm/adjacent_find.h" } - module all_of { private header "__algorithm/all_of.h" } - module any_of { private header "__algorithm/any_of.h" } - module binary_search { private header "__algorithm/binary_search.h" } - module clamp { private header "__algorithm/clamp.h" } - module comp { private header "__algorithm/comp.h" } - module comp_ref_type { private header "__algorithm/comp_ref_type.h" } - module copy { private header "__algorithm/copy.h" } - module copy_backward { private header "__algorithm/copy_backward.h" } - module copy_if { private header "__algorithm/copy_if.h" } - module copy_n { private header "__algorithm/copy_n.h" } - module count { private header "__algorithm/count.h" } - module count_if { private header "__algorithm/count_if.h" } - module equal { private header "__algorithm/equal.h" } - module equal_range { private header "__algorithm/equal_range.h" } - module fill { private header "__algorithm/fill.h" } - module fill_n { private header "__algorithm/fill_n.h" } - module find { private header "__algorithm/find.h" } - module find_end { private header "__algorithm/find_end.h" } - module find_first_of { private header "__algorithm/find_first_of.h" } - module find_if { private header "__algorithm/find_if.h" } - module find_if_not { private header "__algorithm/find_if_not.h" } - module for_each { private header "__algorithm/for_each.h" } - module for_each_n { private header "__algorithm/for_each_n.h" } - module generate { private header "__algorithm/generate.h" } - module generate_n { private header "__algorithm/generate_n.h" } - module half_positive { private header "__algorithm/half_positive.h" } - module in_fun_result { private header "__algorithm/in_fun_result.h" } - module in_in_out_result { private header "__algorithm/in_in_out_result.h" } - module in_in_result { private header "__algorithm/in_in_result.h" } - module in_out_out_result { private header "__algorithm/in_out_out_result.h" } - module in_out_result { private header "__algorithm/in_out_result.h" } - module includes { private header "__algorithm/includes.h" } - module inplace_merge { private header "__algorithm/inplace_merge.h" } - module is_heap { private header "__algorithm/is_heap.h" } - module is_heap_until { private header "__algorithm/is_heap_until.h" } - module is_partitioned { private header "__algorithm/is_partitioned.h" } - module is_permutation { private header "__algorithm/is_permutation.h" } - module is_sorted { private header "__algorithm/is_sorted.h" } - module is_sorted_until { private header "__algorithm/is_sorted_until.h" } - module iter_swap { private header "__algorithm/iter_swap.h" } - module lexicographical_compare { private header "__algorithm/lexicographical_compare.h" } - module lower_bound { private header "__algorithm/lower_bound.h" } - module make_heap { private header "__algorithm/make_heap.h" } - module max { private header "__algorithm/max.h" } - module max_element { private header "__algorithm/max_element.h" } - module merge { private header "__algorithm/merge.h" } - module min { private header "__algorithm/min.h" } - module min_element { private header "__algorithm/min_element.h" } - module minmax { private header "__algorithm/minmax.h" } - module minmax_element { private header "__algorithm/minmax_element.h" } - module mismatch { private header "__algorithm/mismatch.h" } - module move { private header "__algorithm/move.h" } - module move_backward { private header "__algorithm/move_backward.h" } - module next_permutation { private header "__algorithm/next_permutation.h" } - module none_of { private header "__algorithm/none_of.h" } - module nth_element { private header "__algorithm/nth_element.h" } - module partial_sort { private header "__algorithm/partial_sort.h" } - module partial_sort_copy { private header "__algorithm/partial_sort_copy.h" } - module partition { private header "__algorithm/partition.h" } - module partition_copy { private header "__algorithm/partition_copy.h" } - module partition_point { private header "__algorithm/partition_point.h" } - module pop_heap { private header "__algorithm/pop_heap.h" } - module prev_permutation { private header "__algorithm/prev_permutation.h" } - module push_heap { private header "__algorithm/push_heap.h" } - module ranges_min_element { private header "__algorithm/ranges_min_element.h" } - module ranges_swap_ranges { private header "__algorithm/ranges_swap_ranges.h" } - module remove { private header "__algorithm/remove.h" } - module remove_copy { private header "__algorithm/remove_copy.h" } - module remove_copy_if { private header "__algorithm/remove_copy_if.h" } - module remove_if { private header "__algorithm/remove_if.h" } - module replace { private header "__algorithm/replace.h" } - module replace_copy { private header "__algorithm/replace_copy.h" } - module replace_copy_if { private header "__algorithm/replace_copy_if.h" } - module replace_if { private header "__algorithm/replace_if.h" } - module reverse { private header "__algorithm/reverse.h" } - module reverse_copy { private header "__algorithm/reverse_copy.h" } - module rotate { private header "__algorithm/rotate.h" } - module rotate_copy { private header "__algorithm/rotate_copy.h" } - module sample { private header "__algorithm/sample.h" } - module search { private header "__algorithm/search.h" } - module search_n { private header "__algorithm/search_n.h" } - module set_difference { private header "__algorithm/set_difference.h" } - module set_intersection { private header "__algorithm/set_intersection.h" } - module set_symmetric_difference { private header "__algorithm/set_symmetric_difference.h" } - module set_union { private header "__algorithm/set_union.h" } - module shift_left { private header "__algorithm/shift_left.h" } - module shift_right { private header "__algorithm/shift_right.h" } - module shuffle { private header "__algorithm/shuffle.h" } - module sift_down { private header "__algorithm/sift_down.h" } - module sort { private header "__algorithm/sort.h" } - module sort_heap { private header "__algorithm/sort_heap.h" } - module stable_partition { private header "__algorithm/stable_partition.h" } - module stable_sort { private header "__algorithm/stable_sort.h" } - module swap_ranges { private header "__algorithm/swap_ranges.h" } - module transform { private header "__algorithm/transform.h" } - module unique { private header "__algorithm/unique.h" } - module unique_copy { private header "__algorithm/unique_copy.h" } - module unwrap_iter { private header "__algorithm/unwrap_iter.h" } - module upper_bound { private header "__algorithm/upper_bound.h" } - } - } - module any { - header "any" - export * - } - module array { - header "array" - export initializer_list - export * - } - module atomic { - header "atomic" - export * - } - module barrier { - requires cplusplus14 - header "barrier" - export * - } - module bit { - header "bit" - export * - - module __bit { - module bit_cast { private header "__bit/bit_cast.h" } - module byteswap { private header "__bit/byteswap.h" } - } - } - module bitset { - header "bitset" - export string - export iosfwd - export * - } - // No submodule for cassert. It fundamentally needs repeated, textual inclusion. - module charconv { - header "charconv" - export * - - module __charconv { - module chars_format { private header "__charconv/chars_format.h" } - module from_chars_result { private header "__charconv/from_chars_result.h" } - module to_chars_result { private header "__charconv/to_chars_result.h" } - } - - } - module chrono { - header "chrono" - export * - - module __chrono { - module calendar { private header "__chrono/calendar.h" } - module convert_to_timespec { private header "__chrono/convert_to_timespec.h" } - module duration { private header "__chrono/duration.h" } - module file_clock { private header "__chrono/file_clock.h" } - module high_resolution_clock { private header "__chrono/high_resolution_clock.h" } - module steady_clock { private header "__chrono/steady_clock.h" } - module system_clock { private header "__chrono/system_clock.h" } - module time_point { private header "__chrono/time_point.h" } - } - } - module codecvt { - header "codecvt" - export * - } - module compare { - header "compare" - export * - - module __compare { - module common_comparison_category { private header "__compare/common_comparison_category.h" } - module compare_partial_order_fallback { private header "__compare/compare_partial_order_fallback.h" } - module compare_strong_order_fallback { private header "__compare/compare_strong_order_fallback.h" } - module compare_three_way { private header "__compare/compare_three_way.h" } - module compare_three_way_result { private header "__compare/compare_three_way_result.h" } - module compare_weak_order_fallback { private header "__compare/compare_weak_order_fallback.h" } - module is_eq { private header "__compare/is_eq.h" } - module ordering { private header "__compare/ordering.h" } - module partial_order { private header "__compare/partial_order.h" } - module strong_order { private header "__compare/strong_order.h" } - module synth_three_way { private header "__compare/synth_three_way.h" } - module three_way_comparable { private header "__compare/three_way_comparable.h" } - module weak_order { private header "__compare/weak_order.h" } - } - } - module complex { - header "complex" - export * - } - module concepts { - header "concepts" - export * - - module __concepts { - module arithmetic { private header "__concepts/arithmetic.h" } - module assignable { private header "__concepts/assignable.h" } - module boolean_testable { private header "__concepts/boolean_testable.h" } - module class_or_enum { private header "__concepts/class_or_enum.h" } - module common_reference_with { private header "__concepts/common_reference_with.h" } - module common_with { private header "__concepts/common_with.h" } - module constructible { private header "__concepts/constructible.h" } - module convertible_to { private header "__concepts/convertible_to.h" } - module copyable { private header "__concepts/copyable.h" } - module derived_from { private header "__concepts/derived_from.h" } - module destructible { private header "__concepts/destructible.h" } - module different_from { private header "__concepts/different_from.h" } - module equality_comparable { private header "__concepts/equality_comparable.h" } - module invocable { private header "__concepts/invocable.h" } - module movable { private header "__concepts/movable.h" } - module predicate { private header "__concepts/predicate.h" } - module regular { private header "__concepts/regular.h" } - module relation { private header "__concepts/relation.h" } - module same_as { private header "__concepts/same_as.h" } - module semiregular { private header "__concepts/semiregular.h" } - module swappable { private header "__concepts/swappable.h" } - module totally_ordered { private header "__concepts/totally_ordered.h" } - } - } - module condition_variable { - header "condition_variable" - export * - } - module coroutine { - requires coroutines - header "coroutine" - export compare - export * - - module __coroutine { - module coroutine_handle { private header "__coroutine/coroutine_handle.h" } - module coroutine_traits { private header "__coroutine/coroutine_traits.h" } - module noop_coroutine_handle { private header "__coroutine/noop_coroutine_handle.h" } - module trivial_awaitables { private header "__coroutine/trivial_awaitables.h" } - } - } - module deque { - header "deque" - export initializer_list - export * - } - module exception { - header "exception" - export * - } - module execution { - header "execution" - export * - } - module filesystem { - header "filesystem" - export * - - module __filesystem { - module copy_options { private header "__filesystem/copy_options.h" } - module directory_entry { private header "__filesystem/directory_entry.h" } - module directory_iterator { private header "__filesystem/directory_iterator.h" } - module directory_options { private header "__filesystem/directory_options.h" } - module file_status { private header "__filesystem/file_status.h" } - module file_time_type { private header "__filesystem/file_time_type.h" } - module file_type { private header "__filesystem/file_type.h" } - module filesystem_error { private header "__filesystem/filesystem_error.h" } - module operations { private header "__filesystem/operations.h" } - module path { private header "__filesystem/path.h" } - module path_iterator { private header "__filesystem/path_iterator.h" } - module perm_options { private header "__filesystem/perm_options.h" } - module perms { private header "__filesystem/perms.h" } - module recursive_directory_iterator { private header "__filesystem/recursive_directory_iterator.h" } - module space_info { private header "__filesystem/space_info.h" } - module u8path { private header "__filesystem/u8path.h" } - } - } - module format { - header "format" - export * - - module __format { - module format_arg { private header "__format/format_arg.h" } - module format_args { private header "__format/format_args.h" } - module format_context { - private header "__format/format_context.h" - export optional - export locale - } - module format_error { private header "__format/format_error.h" } - module format_fwd { private header "__format/format_fwd.h" } - module format_parse_context { private header "__format/format_parse_context.h" } - module format_string { private header "__format/format_string.h" } - module format_to_n_result { private header "__format/format_to_n_result.h" } - module formatter { private header "__format/formatter.h" } - module formatter_bool { private header "__format/formatter_bool.h" } - module formatter_char { private header "__format/formatter_char.h" } - module formatter_floating_point { private header "__format/formatter_floating_point.h" } - module formatter_integer { private header "__format/formatter_integer.h" } - module formatter_integral { private header "__format/formatter_integral.h" } - module formatter_pointer { private header "__format/formatter_pointer.h" } - module formatter_string { private header "__format/formatter_string.h" } - module parser_std_format_spec { private header "__format/parser_std_format_spec.h" } - } - } - module forward_list { - header "forward_list" - export initializer_list - export * - } - module fstream { - header "fstream" - export * - } - module functional { - header "functional" - export * - - module __functional { - module binary_function { private header "__functional/binary_function.h" } - module binary_negate { private header "__functional/binary_negate.h" } - module bind { private header "__functional/bind.h" } - module bind_back { private header "__functional/bind_back.h" } - module bind_front { private header "__functional/bind_front.h" } - module binder1st { private header "__functional/binder1st.h" } - module binder2nd { private header "__functional/binder2nd.h" } - module compose { private header "__functional/compose.h" } - module default_searcher { private header "__functional/default_searcher.h" } - module function { private header "__functional/function.h" } - module hash { private header "__functional/hash.h" } - module identity { private header "__functional/identity.h" } - module invoke { private header "__functional/invoke.h" } - module is_transparent { private header "__functional/is_transparent.h" } - module mem_fn { private header "__functional/mem_fn.h" } - module mem_fun_ref { private header "__functional/mem_fun_ref.h" } - module not_fn { private header "__functional/not_fn.h" } - module operations { private header "__functional/operations.h" } - module perfect_forward { private header "__functional/perfect_forward.h" } - module pointer_to_binary_function { private header "__functional/pointer_to_binary_function.h" } - module pointer_to_unary_function { private header "__functional/pointer_to_unary_function.h" } - module ranges_operations { private header "__functional/ranges_operations.h" } - module reference_wrapper { private header "__functional/reference_wrapper.h" } - module unary_function { private header "__functional/unary_function.h" } - module unary_negate { private header "__functional/unary_negate.h" } - module unwrap_ref { private header "__functional/unwrap_ref.h" } - module weak_result_type { private header "__functional/weak_result_type.h" } - } - } - module future { - header "future" - export * - } - module initializer_list { - header "initializer_list" - export * - } - module iomanip { - header "iomanip" - export * - } - module ios { - header "ios" - export iosfwd - export * - - module __ios { - module fpos { private header "__ios/fpos.h" } - } - } - module iosfwd { - header "iosfwd" - export * - } - module iostream { - header "iostream" - export ios - export streambuf - export istream - export ostream - export * - } - module istream { - header "istream" - // FIXME: should re-export ios, streambuf? - export * - } - module iterator { - header "iterator" - export * - - module __iterator { - module access { private header "__iterator/access.h" } - module advance { private header "__iterator/advance.h" } - module back_insert_iterator { private header "__iterator/back_insert_iterator.h" } - module common_iterator { private header "__iterator/common_iterator.h" } - module concepts { private header "__iterator/concepts.h" } - module counted_iterator { private header "__iterator/counted_iterator.h" } - module data { private header "__iterator/data.h" } - module default_sentinel { private header "__iterator/default_sentinel.h" } - module distance { private header "__iterator/distance.h" } - module empty { private header "__iterator/empty.h" } - module erase_if_container { private header "__iterator/erase_if_container.h" } - module front_insert_iterator { private header "__iterator/front_insert_iterator.h" } - module incrementable_traits { private header "__iterator/incrementable_traits.h" } - module indirectly_comparable { private header "__iterator/indirectly_comparable.h" } - module insert_iterator { private header "__iterator/insert_iterator.h" } - module istream_iterator { private header "__iterator/istream_iterator.h" } - module istreambuf_iterator { private header "__iterator/istreambuf_iterator.h" } - module iter_move { private header "__iterator/iter_move.h" } - module iter_swap { private header "__iterator/iter_swap.h" } - module iterator { private header "__iterator/iterator.h" } - module iterator_traits { private header "__iterator/iterator_traits.h" } - module move_iterator { private header "__iterator/move_iterator.h" } - module next { private header "__iterator/next.h" } - module ostream_iterator { private header "__iterator/ostream_iterator.h" } - module ostreambuf_iterator { private header "__iterator/ostreambuf_iterator.h" } - module permutable { private header "__iterator/permutable.h" } - module prev { private header "__iterator/prev.h" } - module projected { private header "__iterator/projected.h" } - module readable_traits { private header "__iterator/readable_traits.h" } - module reverse_access { private header "__iterator/reverse_access.h" } - module reverse_iterator { private header "__iterator/reverse_iterator.h" } - module size { private header "__iterator/size.h" } - module unreachable_sentinel { private header "__iterator/unreachable_sentinel.h" } - module wrap_iter { private header "__iterator/wrap_iter.h" } - } - } - module latch { - requires cplusplus14 - header "latch" - export * - } - module limits { - header "limits" - export * - } - module list { - header "list" - export initializer_list - export * - } - module locale { - header "locale" - export * - } - module map { - header "map" - export initializer_list - export * - } - module memory { - header "memory" - export * - - module __memory { - module addressof { private header "__memory/addressof.h" } - module allocation_guard { private header "__memory/allocation_guard.h" } - module allocator { private header "__memory/allocator.h" } - module allocator_arg_t { private header "__memory/allocator_arg_t.h" } - module allocator_traits { private header "__memory/allocator_traits.h" } - module auto_ptr { private header "__memory/auto_ptr.h" } - module compressed_pair { private header "__memory/compressed_pair.h" } - module concepts { private header "__memory/concepts.h" } - module construct_at { private header "__memory/construct_at.h" } - module pointer_traits { private header "__memory/pointer_traits.h" } - module ranges_construct_at { private header "__memory/ranges_construct_at.h" } - module ranges_uninitialized_algorithms { private header "__memory/ranges_uninitialized_algorithms.h" } - module raw_storage_iterator { private header "__memory/raw_storage_iterator.h" } - module shared_ptr { private header "__memory/shared_ptr.h" } - module temporary_buffer { private header "__memory/temporary_buffer.h" } - module uninitialized_algorithms { private header "__memory/uninitialized_algorithms.h" } - module unique_ptr { private header "__memory/unique_ptr.h" } - module uses_allocator { private header "__memory/uses_allocator.h" } - module voidify { private header "__memory/voidify.h" } - } - } - module mutex { - header "mutex" - export * - } - module new { - header "new" - export * - } - module numbers { - header "numbers" - export * - } - module numeric { - header "numeric" - export * - - module __numeric { - module accumulate { private header "__numeric/accumulate.h" } - module adjacent_difference { private header "__numeric/adjacent_difference.h" } - module exclusive_scan { private header "__numeric/exclusive_scan.h" } - module gcd_lcm { private header "__numeric/gcd_lcm.h" } - module inclusive_scan { private header "__numeric/inclusive_scan.h" } - module inner_product { private header "__numeric/inner_product.h" } - module iota { private header "__numeric/iota.h" } - module midpoint { private header "__numeric/midpoint.h" } - module partial_sum { private header "__numeric/partial_sum.h" } - module reduce { private header "__numeric/reduce.h" } - module transform_exclusive_scan { private header "__numeric/transform_exclusive_scan.h" } - module transform_inclusive_scan { private header "__numeric/transform_inclusive_scan.h" } - module transform_reduce { private header "__numeric/transform_reduce.h" } - } - } - module optional { - header "optional" - export * - } - module ostream { - header "ostream" - // FIXME: should re-export ios, streambuf? - export * - } - module queue { - header "queue" - export initializer_list - export * - } - module random { - header "random" - export initializer_list - export * - - module __random { - module bernoulli_distribution { private header "__random/bernoulli_distribution.h" } - module binomial_distribution { private header "__random/binomial_distribution.h" } - module cauchy_distribution { private header "__random/cauchy_distribution.h" } - module chi_squared_distribution { private header "__random/chi_squared_distribution.h" } - module clamp_to_integral { private header "__random/clamp_to_integral.h" } - module default_random_engine { private header "__random/default_random_engine.h" } - module discard_block_engine { private header "__random/discard_block_engine.h" } - module discrete_distribution { private header "__random/discrete_distribution.h" } - module exponential_distribution { private header "__random/exponential_distribution.h" } - module extreme_value_distribution { private header "__random/extreme_value_distribution.h" } - module fisher_f_distribution { private header "__random/fisher_f_distribution.h" } - module gamma_distribution { private header "__random/gamma_distribution.h" } - module generate_canonical { private header "__random/generate_canonical.h" } - module geometric_distribution { private header "__random/geometric_distribution.h" } - module independent_bits_engine { private header "__random/independent_bits_engine.h" } - module is_seed_sequence { private header "__random/is_seed_sequence.h" } - module knuth_b { private header "__random/knuth_b.h" } - module linear_congruential_engine { private header "__random/linear_congruential_engine.h" } - module log2 { private header "__random/log2.h" } - module lognormal_distribution { private header "__random/lognormal_distribution.h" } - module mersenne_twister_engine { private header "__random/mersenne_twister_engine.h" } - module negative_binomial_distribution { private header "__random/negative_binomial_distribution.h" } - module normal_distribution { private header "__random/normal_distribution.h" } - module piecewise_constant_distribution { private header "__random/piecewise_constant_distribution.h" } - module piecewise_linear_distribution { private header "__random/piecewise_linear_distribution.h" } - module poisson_distribution { private header "__random/poisson_distribution.h" } - module random_device { private header "__random/random_device.h" } - module ranlux { private header "__random/ranlux.h" } - module seed_seq { private header "__random/seed_seq.h" } - module shuffle_order_engine { private header "__random/shuffle_order_engine.h" } - module student_t_distribution { private header "__random/student_t_distribution.h" } - module subtract_with_carry_engine { private header "__random/subtract_with_carry_engine.h" } - module uniform_int_distribution { private header "__random/uniform_int_distribution.h" } - module uniform_random_bit_generator { private header "__random/uniform_random_bit_generator.h" } - module uniform_real_distribution { private header "__random/uniform_real_distribution.h" } - module weibull_distribution { private header "__random/weibull_distribution.h" } - } - } - module ranges { - header "ranges" - export compare - export initializer_list - export iterator - export * - - module __ranges { - module access { private header "__ranges/access.h" } - module all { - private header "__ranges/all.h" - export functional.__functional.compose - export functional.__functional.perfect_forward - } - module common_view { private header "__ranges/common_view.h" } - module concepts { private header "__ranges/concepts.h" } - module copyable_box { private header "__ranges/copyable_box.h" } - module counted { - private header "__ranges/counted.h" - export span - } - module dangling { private header "__ranges/dangling.h" } - module data { private header "__ranges/data.h" } - module drop_view { private header "__ranges/drop_view.h" } - module empty { private header "__ranges/empty.h" } - module empty_view { private header "__ranges/empty_view.h" } - module enable_borrowed_range { private header "__ranges/enable_borrowed_range.h" } - module enable_view { private header "__ranges/enable_view.h" } - module iota_view { private header "__ranges/iota_view.h" } - module join_view { private header "__ranges/join_view.h" } - module non_propagating_cache { private header "__ranges/non_propagating_cache.h" } - module owning_view { private header "__ranges/owning_view.h" } - module range_adaptor { private header "__ranges/range_adaptor.h" } - module rbegin { private header "__ranges/rbegin.h" } - module ref_view { private header "__ranges/ref_view.h" } - module rend { private header "__ranges/rend.h" } - module reverse_view { private header "__ranges/reverse_view.h" } - module single_view { private header "__ranges/single_view.h" } - module size { private header "__ranges/size.h" } - module subrange { private header "__ranges/subrange.h" } - module take_view { private header "__ranges/take_view.h" } - module transform_view { - private header "__ranges/transform_view.h" - export functional.__functional.bind_back - export functional.__functional.perfect_forward - } - module view_interface { private header "__ranges/view_interface.h" } - module views { private header "__ranges/views.h" } - } - } - module ratio { - header "ratio" - export * - } - module regex { - header "regex" - export initializer_list - export * - } - module scoped_allocator { - header "scoped_allocator" - export * - } - module semaphore { - requires cplusplus14 - header "semaphore" - export * - } - module set { - header "set" - export initializer_list - export * - } - module shared_mutex { - header "shared_mutex" - export version - } - module span { - header "span" - export ranges.__ranges.enable_borrowed_range - export version - } - module sstream { - header "sstream" - // FIXME: should re-export istream, ostream, ios, streambuf, string? - export * - } - module stack { - header "stack" - export initializer_list - export * - } - module stdexcept { - header "stdexcept" - export * - } - module streambuf { - header "streambuf" - export * - } - module string { - header "string" - export initializer_list - export string_view - export __string - export * - } - module string_view { - header "string_view" - export initializer_list - export __string - export * - } - module strstream { - header "strstream" - export * - } - module system_error { - header "system_error" - export * - } - module thread { - header "thread" - export * - - module __thread { - module poll_with_backoff { private header "__thread/poll_with_backoff.h" } - module timed_backoff_policy { private header "__thread/timed_backoff_policy.h" } - } - } - module tuple { - header "tuple" - export * - } - module type_traits { - header "type_traits" - export functional.__functional.unwrap_ref - export * - } - module typeindex { - header "typeindex" - export * - } - module typeinfo { - header "typeinfo" - export * - } - module unordered_map { - header "unordered_map" - export initializer_list - export * - } - module unordered_set { - header "unordered_set" - export initializer_list - export * - } - module utility { - header "utility" - export initializer_list - export * - - module __utility { - module as_const { private header "__utility/as_const.h" } - module auto_cast { private header "__utility/auto_cast.h" } - module cmp { private header "__utility/cmp.h" } - module declval { private header "__utility/declval.h" } - module exchange { private header "__utility/exchange.h" } - module forward { private header "__utility/forward.h" } - module in_place { private header "__utility/in_place.h" } - module integer_sequence { private header "__utility/integer_sequence.h" } - module move { private header "__utility/move.h" } - module pair { private header "__utility/pair.h" } - module piecewise_construct { private header "__utility/piecewise_construct.h" } - module priority_tag { private header "__utility/priority_tag.h" } - module rel_ops { private header "__utility/rel_ops.h" } - module swap { private header "__utility/swap.h" } - module to_underlying { private header "__utility/to_underlying.h" } - module transaction { private header "__utility/transaction.h" } - module unreachable { private header "__utility/unreachable.h" } - } - } - module valarray { - header "valarray" - export initializer_list - export * - } - module variant { - header "variant" - export * - - module __variant { - module monostate { private header "__variant/monostate.h" } - } - } - module vector { - header "vector" - export initializer_list - export * - } - module version { - header "version" - export * - } - - // __config not modularised due to a bug in Clang - // FIXME: These should be private. - module __availability { private header "__availability" export * } - module __bit_reference { private header "__bit_reference" export * } - module __bits { private header "__bits" export * } - module __debug { header "__debug" export * } - module __errc { private header "__errc" export * } - module __hash_table { header "__hash_table" export * } - module __locale { private header "__locale" export * } - module __mbstate_t { private header "__mbstate_t.h" export * } - module __mutex_base { private header "__mutex_base" export * } - module __node_handle { private header "__node_handle" export * } - module __split_buffer { private header "__split_buffer" export * } - module __std_stream { private header "__std_stream" export * } - module __string { private header "__string" export * } - module __threading_support { header "__threading_support" export * } - module __tree { header "__tree" export * } - module __tuple { private header "__tuple" export * } - module __undef_macros { header "__undef_macros" export * } - - module experimental { - requires cplusplus11 - - module algorithm { - header "experimental/algorithm" - export * - } - module coroutine { - requires coroutines - header "experimental/coroutine" - export * - } - module deque { - header "experimental/deque" - export * - } - module forward_list { - header "experimental/forward_list" - export * - } - module functional { - header "experimental/functional" - export * - } - module iterator { - header "experimental/iterator" - export * - } - module list { - header "experimental/list" - export * - } - module map { - header "experimental/map" - export * - } - module memory_resource { - header "experimental/memory_resource" - export * - } - module propagate_const { - header "experimental/propagate_const" - export * - } - module regex { - header "experimental/regex" - export * - } - module simd { - header "experimental/simd" - export * - } - module set { - header "experimental/set" - export * - } - module span { - header "span" - export * - } - module string { - header "experimental/string" - export * - } - module type_traits { - header "experimental/type_traits" - export * - } - module unordered_map { - header "experimental/unordered_map" - export * - } - module unordered_set { - header "experimental/unordered_set" - export * - } - module utility { - header "experimental/utility" - export * - } - module vector { - header "experimental/vector" - export * - } - // FIXME these should be private - module __memory { - header "experimental/__memory" - export * - } - } // end experimental -} diff --git a/contrib/libs/cxxsupp/libcxx/include/numbers b/contrib/libs/cxxsupp/libcxx/include/numbers deleted file mode 100644 index 9a52d142c4b..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/numbers +++ /dev/null @@ -1,133 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_NUMBERS -#define _LIBCPP_NUMBERS - -/* - numbers synopsis - -namespace std::numbers { - template<class T> inline constexpr T e_v = unspecified; - template<class T> inline constexpr T log2e_v = unspecified; - template<class T> inline constexpr T log10e_v = unspecified; - template<class T> inline constexpr T pi_v = unspecified; - template<class T> inline constexpr T inv_pi_v = unspecified; - template<class T> inline constexpr T inv_sqrtpi_v = unspecified; - template<class T> inline constexpr T ln2_v = unspecified; - template<class T> inline constexpr T ln10_v = unspecified; - template<class T> inline constexpr T sqrt2_v = unspecified; - template<class T> inline constexpr T sqrt3_v = unspecified; - template<class T> inline constexpr T inv_sqrt3_v = unspecified; - template<class T> inline constexpr T egamma_v = unspecified; - template<class T> inline constexpr T phi_v = unspecified; - - template<floating_point T> inline constexpr T e_v<T> = see below; - template<floating_point T> inline constexpr T log2e_v<T> = see below; - template<floating_point T> inline constexpr T log10e_v<T> = see below; - template<floating_point T> inline constexpr T pi_v<T> = see below; - template<floating_point T> inline constexpr T inv_pi_v<T> = see below; - template<floating_point T> inline constexpr T inv_sqrtpi_v<T> = see below; - template<floating_point T> inline constexpr T ln2_v<T> = see below; - template<floating_point T> inline constexpr T ln10_v<T> = see below; - template<floating_point T> inline constexpr T sqrt2_v<T> = see below; - template<floating_point T> inline constexpr T sqrt3_v<T> = see below; - template<floating_point T> inline constexpr T inv_sqrt3_v<T> = see below; - template<floating_point T> inline constexpr T egamma_v<T> = see below; - template<floating_point T> inline constexpr T phi_v<T> = see below; - - inline constexpr double e = e_v<double>; - inline constexpr double log2e = log2e_v<double>; - inline constexpr double log10e = log10e_v<double>; - inline constexpr double pi = pi_v<double>; - inline constexpr double inv_pi = inv_pi_v<double>; - inline constexpr double inv_sqrtpi = inv_sqrtpi_v<double>; - inline constexpr double ln2 = ln2_v<double>; - inline constexpr double ln10 = ln10_v<double>; - inline constexpr double sqrt2 = sqrt2_v<double>; - inline constexpr double sqrt3 = sqrt3_v<double>; - inline constexpr double inv_sqrt3 = inv_sqrt3_v<double>; - inline constexpr double egamma = egamma_v<double>; - inline constexpr double phi = phi_v<double>; -} -*/ - -#include <__config> -#include <concepts> -#include <type_traits> -#include <version> - -#if !defined(_LIBCPP_HAS_NO_CONCEPTS) - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -namespace numbers { - -template <class _Tp> -inline constexpr bool __false = false; - -template <class _Tp> -struct __illformed -{ - static_assert(__false<_Tp>, "A program that instantiates a primary template of a mathematical constant variable template is ill-formed."); -}; - -template <class _Tp> inline constexpr _Tp e_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp log2e_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp log10e_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp pi_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp inv_pi_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp inv_sqrtpi_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp ln2_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp ln10_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp sqrt2_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp sqrt3_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp inv_sqrt3_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp egamma_v = __illformed<_Tp>{}; -template <class _Tp> inline constexpr _Tp phi_v = __illformed<_Tp>{}; - -template <floating_point _Tp> inline constexpr _Tp e_v<_Tp> = 2.718281828459045235360287471352662L; -template <floating_point _Tp> inline constexpr _Tp log2e_v<_Tp> = 1.442695040888963407359924681001892L; -template <floating_point _Tp> inline constexpr _Tp log10e_v<_Tp> = 0.434294481903251827651128918916605L; -template <floating_point _Tp> inline constexpr _Tp pi_v<_Tp> = 3.141592653589793238462643383279502L; -template <floating_point _Tp> inline constexpr _Tp inv_pi_v<_Tp> = 0.318309886183790671537767526745028L; -template <floating_point _Tp> inline constexpr _Tp inv_sqrtpi_v<_Tp> = 0.564189583547756286948079451560772L; -template <floating_point _Tp> inline constexpr _Tp ln2_v<_Tp> = 0.693147180559945309417232121458176L; -template <floating_point _Tp> inline constexpr _Tp ln10_v<_Tp> = 2.302585092994045684017991454684364L; -template <floating_point _Tp> inline constexpr _Tp sqrt2_v<_Tp> = 1.414213562373095048801688724209698L; -template <floating_point _Tp> inline constexpr _Tp sqrt3_v<_Tp> = 1.732050807568877293527446341505872L; -template <floating_point _Tp> inline constexpr _Tp inv_sqrt3_v<_Tp> = 0.577350269189625764509148780501957L; -template <floating_point _Tp> inline constexpr _Tp egamma_v<_Tp> = 0.577215664901532860606512090082402L; -template <floating_point _Tp> inline constexpr _Tp phi_v<_Tp> = 1.618033988749894848204586834365638L; - -inline constexpr double e = e_v<double>; -inline constexpr double log2e = log2e_v<double>; -inline constexpr double log10e = log10e_v<double>; -inline constexpr double pi = pi_v<double>; -inline constexpr double inv_pi = inv_pi_v<double>; -inline constexpr double inv_sqrtpi = inv_sqrtpi_v<double>; -inline constexpr double ln2 = ln2_v<double>; -inline constexpr double ln10 = ln10_v<double>; -inline constexpr double sqrt2 = sqrt2_v<double>; -inline constexpr double sqrt3 = sqrt3_v<double>; -inline constexpr double inv_sqrt3 = inv_sqrt3_v<double>; -inline constexpr double egamma = egamma_v<double>; -inline constexpr double phi = phi_v<double>; - -} // namespace numbers - -_LIBCPP_END_NAMESPACE_STD - -#endif //!defined(_LIBCPP_HAS_NO_CONCEPTS) - -#endif // _LIBCPP_NUMBERS diff --git a/contrib/libs/cxxsupp/libcxx/include/ranges b/contrib/libs/cxxsupp/libcxx/include/ranges deleted file mode 100644 index 2bc9121cd68..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/ranges +++ /dev/null @@ -1,275 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_RANGES -#define _LIBCPP_RANGES - -/* - -#include <compare> // see [compare.syn] -#include <initializer_list> // see [initializer.list.syn] -#include <iterator> // see [iterator.synopsis] - -namespace std::ranges { - inline namespace unspecified { - // [range.access], range access - inline constexpr unspecified begin = unspecified; - inline constexpr unspecified end = unspecified; - inline constexpr unspecified cbegin = unspecified; - inline constexpr unspecified cend = unspecified; - - inline constexpr unspecified size = unspecified; - inline constexpr unspecified ssize = unspecified; - } - - // [range.range], ranges - template<class T> - concept range = see below; - - template<class T> - inline constexpr bool enable_borrowed_range = false; - - template<class T> - using iterator_t = decltype(ranges::begin(declval<T&>())); - template<range R> - using sentinel_t = decltype(ranges::end(declval<R&>())); - template<range R> - using range_difference_t = iter_difference_t<iterator_t<R>>; - template<sized_range R> - using range_size_t = decltype(ranges::size(declval<R&>())); - template<range R> - using range_value_t = iter_value_t<iterator_t<R>>; - template<range R> - using range_reference_t = iter_reference_t<iterator_t<R>>; - template<range R> - using range_rvalue_reference_t = iter_rvalue_reference_t<iterator_t<R>>; - - // [range.sized], sized ranges - template<class> - inline constexpr bool disable_sized_range = false; - - template<class T> - concept sized_range = ...; - - // [range.view], views - template<class T> - inline constexpr bool enable_view = ...; - - struct view_base { }; - - template<class T> - concept view = ...; - - // [range.refinements], other range refinements - template<class R, class T> - concept output_range = see below; - - template<class T> - concept input_range = see below; - - template<class T> - concept forward_range = see below; - - template<class T> - concept bidirectional_range = see below; - - template<class T> - concept random_access_range = see below; - - template<class T> - concept contiguous_range = see below; - - template <class _Tp> - concept common_range = see below; - - template<class T> - concept viewable_range = see below; - - // [view.interface], class template view_interface - template<class D> - requires is_class_v<D> && same_as<D, remove_cv_t<D>> - class view_interface; - - // [range.subrange], sub-ranges - enum class subrange_kind : bool { unsized, sized }; - - template<input_or_output_iterator I, sentinel_for<I> S = I, subrange_kind K = see below> - requires (K == subrange_kind::sized || !sized_sentinel_for<S, I>) - class subrange; - - template<class I, class S, subrange_kind K> - inline constexpr bool enable_borrowed_range<subrange<I, S, K>> = true; - - // [range.dangling], dangling iterator handling - struct dangling; - - template<range R> - using borrowed_iterator_t = see below; - - template<range R> - using borrowed_subrange_t = see below; - - // [range.empty], empty view - template<class T> - requires is_object_v<T> - class empty_view; - - // [range.all], all view - namespace views { - inline constexpr unspecified all = unspecified; - - template<viewable_range R> - using all_t = decltype(all(declval<R>())); - } - - template<range R> - requires is_object_v<R> - class ref_view; - - template<class T> - inline constexpr bool enable_borrowed_range<ref_view<T>> = true; - - template<range R> - requires see below - class owning_view; - - template<class T> - inline constexpr bool enable_borrowed_range<owning_view<T>> = enable_borrowed_range<T>; - - // [range.drop], drop view - template<view V> - class drop_view; - - template<class T> - inline constexpr bool enable_borrowed_range<drop_view<T>> = enable_borrowed_range<T>; - - // [range.transform], transform view - template<input_range V, copy_constructible F> - requires view<V> && is_object_v<F> && - regular_invocable<F&, range_reference_t<V>> && - can-reference<invoke_result_t<F&, range_reference_t<V>>> - class transform_view; - - // [range.counted], counted view - namespace views { inline constexpr unspecified counted = unspecified; } - - // [range.common], common view - template<view V> - requires (!common_range<V> && copyable<iterator_t<V>>) - class common_view; - - // [range.reverse], reverse view - template<view V> - requires bidirectional_range<V> - class reverse_view; - - template<class T> - inline constexpr bool enable_borrowed_range<reverse_view<T>> = enable_borrowed_range<T>; - - template<class T> - inline constexpr bool enable_borrowed_range<common_view<T>> = enable_borrowed_range<T>; - - // [range.take], take view - template<view> class take_view; - - template<class T> - inline constexpr bool enable_borrowed_range<take_view<T>> = enable_borrowed_range<T>; - - template<copy_constructible T> - requires is_object_v<T> - class single_view; - - template<weakly_incrementable W, semiregular Bound = unreachable_sentinel_t> - requires weakly-equality-comparable-with<W, Bound> && copyable<W> - class iota_view; - - template<class W, class Bound> - inline constexpr bool enable_borrowed_range<iota_view<W, Bound>> = true; - - // [range.join], join view - template<input_range V> - requires view<V> && input_range<range_reference_t<V>> - class join_view; -} - -namespace std { - namespace views = ranges::views; - - template<class T> struct tuple_size; - template<size_t I, class T> struct tuple_element; - - template<class I, class S, ranges::subrange_kind K> - struct tuple_size<ranges::subrange<I, S, K>> - : integral_constant<size_t, 2> {}; - - template<class I, class S, ranges::subrange_kind K> - struct tuple_element<0, ranges::subrange<I, S, K>> { - using type = I; - }; - - template<class I, class S, ranges::subrange_kind K> - struct tuple_element<1, ranges::subrange<I, S, K>> { - using type = S; - }; - - template<class I, class S, ranges::subrange_kind K> - struct tuple_element<0, const ranges::subrange<I, S, K>> { - using type = I; - }; - - template<class I, class S, ranges::subrange_kind K> - struct tuple_element<1, const ranges::subrange<I, S, K>> { - using type = S; - }; -} -*/ - -// Make sure all feature-test macros are available. -#include <version> -// Enable the contents of the header only when libc++ was built with LIBCXX_ENABLE_INCOMPLETE_FEATURES. -#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) - -#include <__config> -#include <__ranges/access.h> -#include <__ranges/all.h> -#include <__ranges/common_view.h> -#include <__ranges/concepts.h> -#include <__ranges/counted.h> -#include <__ranges/dangling.h> -#include <__ranges/data.h> -#include <__ranges/drop_view.h> -#include <__ranges/empty.h> -#include <__ranges/empty_view.h> -#include <__ranges/enable_borrowed_range.h> -#include <__ranges/enable_view.h> -#include <__ranges/iota_view.h> -#include <__ranges/join_view.h> -#include <__ranges/rbegin.h> -#include <__ranges/ref_view.h> -#include <__ranges/rend.h> -#include <__ranges/reverse_view.h> -#include <__ranges/single_view.h> -#include <__ranges/size.h> -#include <__ranges/subrange.h> -#include <__ranges/take_view.h> -#include <__ranges/transform_view.h> -#include <__ranges/view_interface.h> -#include <__ranges/views.h> -#include <compare> // Required by the standard. -#include <initializer_list> // Required by the standard. -#include <iterator> // Required by the standard. -#include <type_traits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_RANGES) - -#endif // _LIBCPP_RANGES diff --git a/contrib/libs/cxxsupp/libcxx/include/scoped_allocator b/contrib/libs/cxxsupp/libcxx/include/scoped_allocator deleted file mode 100644 index fe6d606ad14..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/scoped_allocator +++ /dev/null @@ -1,694 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_SCOPED_ALLOCATOR -#define _LIBCPP_SCOPED_ALLOCATOR - -/* - scoped_allocator synopsis - -namespace std -{ - -template <class OuterAlloc, class... InnerAllocs> -class scoped_allocator_adaptor : public OuterAlloc -{ - typedef allocator_traits<OuterAlloc> OuterTraits; // exposition only - scoped_allocator_adaptor<InnerAllocs...> inner; // exposition only -public: - - typedef OuterAlloc outer_allocator_type; - typedef see below inner_allocator_type; - - typedef typename OuterTraits::value_type value_type; - typedef typename OuterTraits::size_type size_type; - typedef typename OuterTraits::difference_type difference_type; - typedef typename OuterTraits::pointer pointer; - typedef typename OuterTraits::const_pointer const_pointer; - typedef typename OuterTraits::void_pointer void_pointer; - typedef typename OuterTraits::const_void_pointer const_void_pointer; - - typedef see below propagate_on_container_copy_assignment; - typedef see below propagate_on_container_move_assignment; - typedef see below propagate_on_container_swap; - typedef see below is_always_equal; - - template <class Tp> - struct rebind - { - typedef scoped_allocator_adaptor< - OuterTraits::template rebind_alloc<Tp>, InnerAllocs...> other; - }; - - scoped_allocator_adaptor(); - template <class OuterA2> - scoped_allocator_adaptor(OuterA2&& outerAlloc, - const InnerAllocs&... innerAllocs) noexcept; - scoped_allocator_adaptor(const scoped_allocator_adaptor& other) noexcept; - scoped_allocator_adaptor(scoped_allocator_adaptor&& other) noexcept; - template <class OuterA2> - scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other) noexcept; - template <class OuterA2> - scoped_allocator_adaptor(const scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other) noexcept; - - scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&) = default; - scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&) = default; - ~scoped_allocator_adaptor(); - - inner_allocator_type& inner_allocator() noexcept; - const inner_allocator_type& inner_allocator() const noexcept; - - outer_allocator_type& outer_allocator() noexcept; - const outer_allocator_type& outer_allocator() const noexcept; - - pointer allocate(size_type n); // [[nodiscard]] in C++20 - pointer allocate(size_type n, const_void_pointer hint); // [[nodiscard]] in C++20 - void deallocate(pointer p, size_type n) noexcept; - - size_type max_size() const; - template <class T, class... Args> void construct(T* p, Args&& args); - template <class T1, class T2, class... Args1, class... Args2> - void construct(pair<T1, T2>* p, piecewise_construct t, tuple<Args1...> x, - tuple<Args2...> y); - template <class T1, class T2> - void construct(pair<T1, T2>* p); - template <class T1, class T2, class U, class V> - void construct(pair<T1, T2>* p, U&& x, V&& y); - template <class T1, class T2, class U, class V> - void construct(pair<T1, T2>* p, const pair<U, V>& x); - template <class T1, class T2, class U, class V> - void construct(pair<T1, T2>* p, pair<U, V>&& x); - template <class T> void destroy(T* p); - - template <class T> void destroy(T* p) noexcept; - - scoped_allocator_adaptor select_on_container_copy_construction() const noexcept; -}; - -template<class OuterAlloc, class... InnerAllocs> - scoped_allocator_adaptor(OuterAlloc, InnerAllocs...) - -> scoped_allocator_adaptor<OuterAlloc, InnerAllocs...>; - -template <class OuterA1, class OuterA2, class... InnerAllocs> - bool - operator==(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a, - const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b) noexcept; - -template <class OuterA1, class OuterA2, class... InnerAllocs> - bool - operator!=(const scoped_allocator_adaptor<OuterA1, InnerAllocs...>& a, - const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& b) noexcept; - -} // std - -*/ - -#include <__config> -#include <__utility/forward.h> -#include <memory> -#include <version> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if !defined(_LIBCPP_CXX03_LANG) - -// scoped_allocator_adaptor - -template <class ..._Allocs> -class scoped_allocator_adaptor; - -template <class ..._Allocs> struct __get_poc_copy_assignment; - -template <class _A0> -struct __get_poc_copy_assignment<_A0> -{ - static const bool value = allocator_traits<_A0>:: - propagate_on_container_copy_assignment::value; -}; - -template <class _A0, class ..._Allocs> -struct __get_poc_copy_assignment<_A0, _Allocs...> -{ - static const bool value = - allocator_traits<_A0>::propagate_on_container_copy_assignment::value || - __get_poc_copy_assignment<_Allocs...>::value; -}; - -template <class ..._Allocs> struct __get_poc_move_assignment; - -template <class _A0> -struct __get_poc_move_assignment<_A0> -{ - static const bool value = allocator_traits<_A0>:: - propagate_on_container_move_assignment::value; -}; - -template <class _A0, class ..._Allocs> -struct __get_poc_move_assignment<_A0, _Allocs...> -{ - static const bool value = - allocator_traits<_A0>::propagate_on_container_move_assignment::value || - __get_poc_move_assignment<_Allocs...>::value; -}; - -template <class ..._Allocs> struct __get_poc_swap; - -template <class _A0> -struct __get_poc_swap<_A0> -{ - static const bool value = allocator_traits<_A0>:: - propagate_on_container_swap::value; -}; - -template <class _A0, class ..._Allocs> -struct __get_poc_swap<_A0, _Allocs...> -{ - static const bool value = - allocator_traits<_A0>::propagate_on_container_swap::value || - __get_poc_swap<_Allocs...>::value; -}; - -template <class ..._Allocs> struct __get_is_always_equal; - -template <class _A0> -struct __get_is_always_equal<_A0> -{ - static const bool value = allocator_traits<_A0>::is_always_equal::value; -}; - -template <class _A0, class ..._Allocs> -struct __get_is_always_equal<_A0, _Allocs...> -{ - static const bool value = - allocator_traits<_A0>::is_always_equal::value && - __get_is_always_equal<_Allocs...>::value; -}; - -template <class ..._Allocs> -class __scoped_allocator_storage; - -template <class _OuterAlloc, class... _InnerAllocs> -class __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...> - : public _OuterAlloc -{ - typedef _OuterAlloc outer_allocator_type; -protected: - typedef scoped_allocator_adaptor<_InnerAllocs...> inner_allocator_type; - -private: - inner_allocator_type __inner_; - -protected: - - _LIBCPP_INLINE_VISIBILITY - __scoped_allocator_storage() _NOEXCEPT {} - - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, _OuterA2>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - __scoped_allocator_storage(_OuterA2&& __outerAlloc, - const _InnerAllocs& ...__innerAllocs) _NOEXCEPT - : outer_allocator_type(_VSTD::forward<_OuterA2>(__outerAlloc)), - __inner_(__innerAllocs...) {} - - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, const _OuterA2&>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - __scoped_allocator_storage( - const __scoped_allocator_storage<_OuterA2, _InnerAllocs...>& __other) _NOEXCEPT - : outer_allocator_type(__other.outer_allocator()), - __inner_(__other.inner_allocator()) {} - - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, _OuterA2>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - __scoped_allocator_storage( - __scoped_allocator_storage<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT - : outer_allocator_type(_VSTD::move(__other.outer_allocator())), - __inner_(_VSTD::move(__other.inner_allocator())) {} - - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, _OuterA2>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - __scoped_allocator_storage(_OuterA2&& __o, - const inner_allocator_type& __i) _NOEXCEPT - : outer_allocator_type(_VSTD::forward<_OuterA2>(__o)), - __inner_(__i) - { - } - - _LIBCPP_INLINE_VISIBILITY - inner_allocator_type& inner_allocator() _NOEXCEPT {return __inner_;} - _LIBCPP_INLINE_VISIBILITY - const inner_allocator_type& inner_allocator() const _NOEXCEPT {return __inner_;} - - _LIBCPP_INLINE_VISIBILITY - outer_allocator_type& outer_allocator() _NOEXCEPT - {return static_cast<outer_allocator_type&>(*this);} - _LIBCPP_INLINE_VISIBILITY - const outer_allocator_type& outer_allocator() const _NOEXCEPT - {return static_cast<const outer_allocator_type&>(*this);} - - scoped_allocator_adaptor<outer_allocator_type, _InnerAllocs...> - _LIBCPP_INLINE_VISIBILITY - select_on_container_copy_construction() const _NOEXCEPT - { - return scoped_allocator_adaptor<outer_allocator_type, _InnerAllocs...> - ( - allocator_traits<outer_allocator_type>:: - select_on_container_copy_construction(outer_allocator()), - allocator_traits<inner_allocator_type>:: - select_on_container_copy_construction(inner_allocator()) - ); - } - - template <class...> friend class __scoped_allocator_storage; -}; - -template <class _OuterAlloc> -class __scoped_allocator_storage<_OuterAlloc> - : public _OuterAlloc -{ - typedef _OuterAlloc outer_allocator_type; -protected: - typedef scoped_allocator_adaptor<_OuterAlloc> inner_allocator_type; - - _LIBCPP_INLINE_VISIBILITY - __scoped_allocator_storage() _NOEXCEPT {} - - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, _OuterA2>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - __scoped_allocator_storage(_OuterA2&& __outerAlloc) _NOEXCEPT - : outer_allocator_type(_VSTD::forward<_OuterA2>(__outerAlloc)) {} - - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, const _OuterA2&>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - __scoped_allocator_storage( - const __scoped_allocator_storage<_OuterA2>& __other) _NOEXCEPT - : outer_allocator_type(__other.outer_allocator()) {} - - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, _OuterA2>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - __scoped_allocator_storage( - __scoped_allocator_storage<_OuterA2>&& __other) _NOEXCEPT - : outer_allocator_type(_VSTD::move(__other.outer_allocator())) {} - - _LIBCPP_INLINE_VISIBILITY - inner_allocator_type& inner_allocator() _NOEXCEPT - {return static_cast<inner_allocator_type&>(*this);} - _LIBCPP_INLINE_VISIBILITY - const inner_allocator_type& inner_allocator() const _NOEXCEPT - {return static_cast<const inner_allocator_type&>(*this);} - - _LIBCPP_INLINE_VISIBILITY - outer_allocator_type& outer_allocator() _NOEXCEPT - {return static_cast<outer_allocator_type&>(*this);} - _LIBCPP_INLINE_VISIBILITY - const outer_allocator_type& outer_allocator() const _NOEXCEPT - {return static_cast<const outer_allocator_type&>(*this);} - - _LIBCPP_INLINE_VISIBILITY - scoped_allocator_adaptor<outer_allocator_type> - select_on_container_copy_construction() const _NOEXCEPT - {return scoped_allocator_adaptor<outer_allocator_type>( - allocator_traits<outer_allocator_type>:: - select_on_container_copy_construction(outer_allocator()) - );} - - __scoped_allocator_storage(const outer_allocator_type& __o, - const inner_allocator_type& __i) _NOEXCEPT; - - template <class...> friend class __scoped_allocator_storage; -}; - -// __outermost - -template <class _Alloc> -decltype(declval<_Alloc>().outer_allocator(), true_type()) -__has_outer_allocator_test(_Alloc&& __a); - -template <class _Alloc> -false_type -__has_outer_allocator_test(const volatile _Alloc& __a); - -template <class _Alloc> -struct __has_outer_allocator - : public common_type - < - decltype(__has_outer_allocator_test(declval<_Alloc&>())) - >::type -{ -}; - -template <class _Alloc, bool = __has_outer_allocator<_Alloc>::value> -struct __outermost -{ - typedef _Alloc type; - _LIBCPP_INLINE_VISIBILITY - type& operator()(type& __a) const _NOEXCEPT {return __a;} -}; - -template <class _Alloc> -struct __outermost<_Alloc, true> -{ - typedef typename remove_reference - < - decltype(declval<_Alloc>().outer_allocator()) - >::type _OuterAlloc; - typedef typename __outermost<_OuterAlloc>::type type; - _LIBCPP_INLINE_VISIBILITY - type& operator()(_Alloc& __a) const _NOEXCEPT - {return __outermost<_OuterAlloc>()(__a.outer_allocator());} -}; - -template <class _OuterAlloc, class... _InnerAllocs> -class _LIBCPP_TEMPLATE_VIS scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...> - : public __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...> -{ - typedef __scoped_allocator_storage<_OuterAlloc, _InnerAllocs...> base; - typedef allocator_traits<_OuterAlloc> _OuterTraits; -public: - typedef _OuterAlloc outer_allocator_type; - typedef typename base::inner_allocator_type inner_allocator_type; - typedef typename _OuterTraits::size_type size_type; - typedef typename _OuterTraits::difference_type difference_type; - typedef typename _OuterTraits::pointer pointer; - typedef typename _OuterTraits::const_pointer const_pointer; - typedef typename _OuterTraits::void_pointer void_pointer; - typedef typename _OuterTraits::const_void_pointer const_void_pointer; - - typedef integral_constant - < - bool, - __get_poc_copy_assignment<outer_allocator_type, - _InnerAllocs...>::value - > propagate_on_container_copy_assignment; - typedef integral_constant - < - bool, - __get_poc_move_assignment<outer_allocator_type, - _InnerAllocs...>::value - > propagate_on_container_move_assignment; - typedef integral_constant - < - bool, - __get_poc_swap<outer_allocator_type, _InnerAllocs...>::value - > propagate_on_container_swap; - typedef integral_constant - < - bool, - __get_is_always_equal<outer_allocator_type, _InnerAllocs...>::value - > is_always_equal; - - template <class _Tp> - struct rebind - { - typedef scoped_allocator_adaptor - < - typename _OuterTraits::template rebind_alloc<_Tp>, _InnerAllocs... - > other; - }; - - _LIBCPP_INLINE_VISIBILITY - scoped_allocator_adaptor() _NOEXCEPT {} - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, _OuterA2>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - scoped_allocator_adaptor(_OuterA2&& __outerAlloc, - const _InnerAllocs& ...__innerAllocs) _NOEXCEPT - : base(_VSTD::forward<_OuterA2>(__outerAlloc), __innerAllocs...) {} - // scoped_allocator_adaptor(const scoped_allocator_adaptor& __other) = default; - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, const _OuterA2&>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - scoped_allocator_adaptor( - const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __other) _NOEXCEPT - : base(__other) {} - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, _OuterA2>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - scoped_allocator_adaptor( - scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>&& __other) _NOEXCEPT - : base(_VSTD::move(__other)) {} - - // scoped_allocator_adaptor& operator=(const scoped_allocator_adaptor&) = default; - // scoped_allocator_adaptor& operator=(scoped_allocator_adaptor&&) = default; - // ~scoped_allocator_adaptor() = default; - - _LIBCPP_INLINE_VISIBILITY - inner_allocator_type& inner_allocator() _NOEXCEPT - {return base::inner_allocator();} - _LIBCPP_INLINE_VISIBILITY - const inner_allocator_type& inner_allocator() const _NOEXCEPT - {return base::inner_allocator();} - - _LIBCPP_INLINE_VISIBILITY - outer_allocator_type& outer_allocator() _NOEXCEPT - {return base::outer_allocator();} - _LIBCPP_INLINE_VISIBILITY - const outer_allocator_type& outer_allocator() const _NOEXCEPT - {return base::outer_allocator();} - - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY - pointer allocate(size_type __n) - {return allocator_traits<outer_allocator_type>:: - allocate(outer_allocator(), __n);} - _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY - pointer allocate(size_type __n, const_void_pointer __hint) - {return allocator_traits<outer_allocator_type>:: - allocate(outer_allocator(), __n, __hint);} - - _LIBCPP_INLINE_VISIBILITY - void deallocate(pointer __p, size_type __n) _NOEXCEPT - {allocator_traits<outer_allocator_type>:: - deallocate(outer_allocator(), __p, __n);} - - _LIBCPP_INLINE_VISIBILITY - size_type max_size() const - {return allocator_traits<outer_allocator_type>::max_size(outer_allocator());} - - template <class _Tp, class... _Args> - _LIBCPP_INLINE_VISIBILITY - void construct(_Tp* __p, _Args&& ...__args) - {__construct(__uses_alloc_ctor<_Tp, inner_allocator_type&, _Args...>(), - __p, _VSTD::forward<_Args>(__args)...);} - - template <class _T1, class _T2, class... _Args1, class... _Args2> - void construct(pair<_T1, _T2>* __p, piecewise_construct_t, - tuple<_Args1...> __x, tuple<_Args2...> __y) - { - typedef __outermost<outer_allocator_type> _OM; - allocator_traits<typename _OM::type>::construct( - _OM()(outer_allocator()), __p, piecewise_construct - , __transform_tuple( - typename __uses_alloc_ctor< - _T1, inner_allocator_type&, _Args1... - >::type() - , _VSTD::move(__x) - , typename __make_tuple_indices<sizeof...(_Args1)>::type{} - ) - , __transform_tuple( - typename __uses_alloc_ctor< - _T2, inner_allocator_type&, _Args2... - >::type() - , _VSTD::move(__y) - , typename __make_tuple_indices<sizeof...(_Args2)>::type{} - ) - ); - } - - template <class _T1, class _T2> - void construct(pair<_T1, _T2>* __p) - { construct(__p, piecewise_construct, tuple<>{}, tuple<>{}); } - - template <class _T1, class _T2, class _Up, class _Vp> - void construct(pair<_T1, _T2>* __p, _Up&& __x, _Vp&& __y) { - construct(__p, piecewise_construct, - _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x)), - _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__y))); - } - - template <class _T1, class _T2, class _Up, class _Vp> - void construct(pair<_T1, _T2>* __p, const pair<_Up, _Vp>& __x) { - construct(__p, piecewise_construct, - _VSTD::forward_as_tuple(__x.first), - _VSTD::forward_as_tuple(__x.second)); - } - - template <class _T1, class _T2, class _Up, class _Vp> - void construct(pair<_T1, _T2>* __p, pair<_Up, _Vp>&& __x) { - construct(__p, piecewise_construct, - _VSTD::forward_as_tuple(_VSTD::forward<_Up>(__x.first)), - _VSTD::forward_as_tuple(_VSTD::forward<_Vp>(__x.second))); - } - - template <class _Tp> - _LIBCPP_INLINE_VISIBILITY - void destroy(_Tp* __p) - { - typedef __outermost<outer_allocator_type> _OM; - allocator_traits<typename _OM::type>:: - destroy(_OM()(outer_allocator()), __p); - } - - _LIBCPP_INLINE_VISIBILITY - scoped_allocator_adaptor select_on_container_copy_construction() const _NOEXCEPT - {return base::select_on_container_copy_construction();} - -private: - - - template <class _OuterA2, - class = typename enable_if< - is_constructible<outer_allocator_type, _OuterA2>::value - >::type> - _LIBCPP_INLINE_VISIBILITY - scoped_allocator_adaptor(_OuterA2&& __o, - const inner_allocator_type& __i) _NOEXCEPT - : base(_VSTD::forward<_OuterA2>(__o), __i) {} - - template <class _Tp, class... _Args> - _LIBCPP_INLINE_VISIBILITY - void __construct(integral_constant<int, 0>, _Tp* __p, _Args&& ...__args) - { - typedef __outermost<outer_allocator_type> _OM; - allocator_traits<typename _OM::type>::construct - ( - _OM()(outer_allocator()), - __p, - _VSTD::forward<_Args>(__args)... - ); - } - - template <class _Tp, class... _Args> - _LIBCPP_INLINE_VISIBILITY - void __construct(integral_constant<int, 1>, _Tp* __p, _Args&& ...__args) - { - typedef __outermost<outer_allocator_type> _OM; - allocator_traits<typename _OM::type>::construct - ( - _OM()(outer_allocator()), - __p, allocator_arg, inner_allocator(), - _VSTD::forward<_Args>(__args)... - ); - } - - template <class _Tp, class... _Args> - _LIBCPP_INLINE_VISIBILITY - void __construct(integral_constant<int, 2>, _Tp* __p, _Args&& ...__args) - { - typedef __outermost<outer_allocator_type> _OM; - allocator_traits<typename _OM::type>::construct - ( - _OM()(outer_allocator()), - __p, - _VSTD::forward<_Args>(__args)..., - inner_allocator() - ); - } - - template <class ..._Args, size_t ..._Idx> - _LIBCPP_INLINE_VISIBILITY - tuple<_Args&&...> - __transform_tuple(integral_constant<int, 0>, tuple<_Args...>&& __t, - __tuple_indices<_Idx...>) - { - return _VSTD::forward_as_tuple(_VSTD::get<_Idx>(_VSTD::move(__t))...); - } - - template <class ..._Args, size_t ..._Idx> - _LIBCPP_INLINE_VISIBILITY - tuple<allocator_arg_t, inner_allocator_type&, _Args&&...> - __transform_tuple(integral_constant<int, 1>, tuple<_Args...> && __t, - __tuple_indices<_Idx...>) - { - using _Tup = tuple<allocator_arg_t, inner_allocator_type&, _Args&&...>; - return _Tup(allocator_arg, inner_allocator(), - _VSTD::get<_Idx>(_VSTD::move(__t))...); - } - - template <class ..._Args, size_t ..._Idx> - _LIBCPP_INLINE_VISIBILITY - tuple<_Args&&..., inner_allocator_type&> - __transform_tuple(integral_constant<int, 2>, tuple<_Args...> && __t, - __tuple_indices<_Idx...>) - { - using _Tup = tuple<_Args&&..., inner_allocator_type&>; - return _Tup(_VSTD::get<_Idx>(_VSTD::move(__t))..., inner_allocator()); - } - - template <class...> friend class __scoped_allocator_storage; -}; - -#if _LIBCPP_STD_VER > 14 -template<class _OuterAlloc, class... _InnerAllocs> - scoped_allocator_adaptor(_OuterAlloc, _InnerAllocs...) - -> scoped_allocator_adaptor<_OuterAlloc, _InnerAllocs...>; -#endif - -template <class _OuterA1, class _OuterA2> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator==(const scoped_allocator_adaptor<_OuterA1>& __a, - const scoped_allocator_adaptor<_OuterA2>& __b) _NOEXCEPT -{ - return __a.outer_allocator() == __b.outer_allocator(); -} - -template <class _OuterA1, class _OuterA2, class _InnerA0, class... _InnerAllocs> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator==(const scoped_allocator_adaptor<_OuterA1, _InnerA0, _InnerAllocs...>& __a, - const scoped_allocator_adaptor<_OuterA2, _InnerA0, _InnerAllocs...>& __b) _NOEXCEPT -{ - return __a.outer_allocator() == __b.outer_allocator() && - __a.inner_allocator() == __b.inner_allocator(); -} - -template <class _OuterA1, class _OuterA2, class... _InnerAllocs> -inline _LIBCPP_INLINE_VISIBILITY -bool -operator!=(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a, - const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __b) _NOEXCEPT -{ - return !(__a == __b); -} - -#endif // !defined(_LIBCPP_CXX03_LANG) - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_SCOPED_ALLOCATOR diff --git a/contrib/libs/cxxsupp/libcxx/include/semaphore b/contrib/libs/cxxsupp/libcxx/include/semaphore deleted file mode 100644 index 753d50f5126..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/semaphore +++ /dev/null @@ -1,188 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_SEMAPHORE -#define _LIBCPP_SEMAPHORE - -/* - semaphore synopsis - -namespace std { - -template<ptrdiff_t least_max_value = implementation-defined> -class counting_semaphore -{ -public: -static constexpr ptrdiff_t max() noexcept; - -constexpr explicit counting_semaphore(ptrdiff_t desired); -~counting_semaphore(); - -counting_semaphore(const counting_semaphore&) = delete; -counting_semaphore& operator=(const counting_semaphore&) = delete; - -void release(ptrdiff_t update = 1); -void acquire(); -bool try_acquire() noexcept; -template<class Rep, class Period> - bool try_acquire_for(const chrono::duration<Rep, Period>& rel_time); -template<class Clock, class Duration> - bool try_acquire_until(const chrono::time_point<Clock, Duration>& abs_time); - -private: -ptrdiff_t counter; // exposition only -}; - -using binary_semaphore = counting_semaphore<1>; - -} - -*/ - -#include <__availability> -#include <__config> -#include <__thread/timed_backoff_policy.h> -#include <__threading_support> -#include <atomic> -#include <version> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#ifdef _LIBCPP_HAS_NO_THREADS -# error <semaphore> is not supported on this single threaded system -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if _LIBCPP_STD_VER >= 14 - -_LIBCPP_BEGIN_NAMESPACE_STD - -/* - -__atomic_semaphore_base is the general-case implementation. -It is a typical Dijkstra semaphore algorithm over atomics, wait and notify -functions. It avoids contention against users' own use of those facilities. - -*/ - -class __atomic_semaphore_base -{ - __atomic_base<ptrdiff_t> __a; - -public: - _LIBCPP_INLINE_VISIBILITY - constexpr explicit __atomic_semaphore_base(ptrdiff_t __count) : __a(__count) - { - } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - void release(ptrdiff_t __update = 1) - { - if(0 < __a.fetch_add(__update, memory_order_release)) - ; - else if(__update > 1) - __a.notify_all(); - else - __a.notify_one(); - } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - void acquire() - { - auto const __test_fn = [this]() -> bool { - auto __old = __a.load(memory_order_relaxed); - return (__old != 0) && __a.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed); - }; - __cxx_atomic_wait(&__a.__a_, __test_fn); - } - template <class Rep, class Period> - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - bool try_acquire_for(chrono::duration<Rep, Period> const& __rel_time) - { - if (__rel_time == chrono::duration<Rep, Period>::zero()) - return try_acquire(); - auto const __test_fn = [this]() { return try_acquire(); }; - return __libcpp_thread_poll_with_backoff(__test_fn, __libcpp_timed_backoff_policy(), __rel_time); - } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - bool try_acquire() - { - auto __old = __a.load(memory_order_acquire); - while (true) { - if (__old == 0) - return false; - if (__a.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed)) - return true; - } - } -}; - -#define _LIBCPP_SEMAPHORE_MAX (numeric_limits<ptrdiff_t>::max()) - -template<ptrdiff_t __least_max_value = _LIBCPP_SEMAPHORE_MAX> -class counting_semaphore -{ - __atomic_semaphore_base __semaphore; - -public: - static constexpr ptrdiff_t max() noexcept { - return __least_max_value; - } - - _LIBCPP_INLINE_VISIBILITY - constexpr explicit counting_semaphore(ptrdiff_t __count) : __semaphore(__count) { } - ~counting_semaphore() = default; - - counting_semaphore(const counting_semaphore&) = delete; - counting_semaphore& operator=(const counting_semaphore&) = delete; - - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - void release(ptrdiff_t __update = 1) - { - __semaphore.release(__update); - } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - void acquire() - { - __semaphore.acquire(); - } - template<class Rep, class Period> - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - bool try_acquire_for(chrono::duration<Rep, Period> const& __rel_time) - { - return __semaphore.try_acquire_for(chrono::duration_cast<chrono::nanoseconds>(__rel_time)); - } - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - bool try_acquire() - { - return __semaphore.try_acquire(); - } - template <class Clock, class Duration> - _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY - bool try_acquire_until(chrono::time_point<Clock, Duration> const& __abs_time) - { - auto const current = Clock::now(); - if (current >= __abs_time) - return try_acquire(); - else - return try_acquire_for(__abs_time - current); - } -}; - -using binary_semaphore = counting_semaphore<1>; - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_STD_VER >= 14 - -_LIBCPP_POP_MACROS - -#endif //_LIBCPP_SEMAPHORE diff --git a/contrib/libs/cxxsupp/libcxx/include/tgmath.h b/contrib/libs/cxxsupp/libcxx/include/tgmath.h deleted file mode 100644 index c65091708a9..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/tgmath.h +++ /dev/null @@ -1,36 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP_TGMATH_H -#define _LIBCPP_TGMATH_H - -/* - tgmath.h synopsis - -#include <ctgmath> - -*/ - -#include <__config> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#ifdef __cplusplus - -#include <ctgmath> - -#else // __cplusplus - -#include_next <tgmath.h> - -#endif // __cplusplus - -#endif // _LIBCPP_TGMATH_H diff --git a/contrib/libs/cxxsupp/libcxx/include/use_ansi.h b/contrib/libs/cxxsupp/libcxx/include/use_ansi.h deleted file mode 100644 index 2b6f36d4eff..00000000000 --- a/contrib/libs/cxxsupp/libcxx/include/use_ansi.h +++ /dev/null @@ -1,3 +0,0 @@ -// Empty header to prevent MSVC one from inclusion. -// This MSVC header adds Microsoft STL to the linker arguments -// which causes conflicts with libc++.
\ No newline at end of file |
