mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-03 09:48:29 +00:00
Release Cosmopolitan v3.6.0
This release is an atomic upgrade to GCC 14.1.0 with C23 and C++23
This commit is contained in:
parent
62ace3623a
commit
5660ec4741
1585 changed files with 117353 additions and 271644 deletions
41
third_party/libcxx/experimental/__config
vendored
41
third_party/libcxx/experimental/__config
vendored
|
@ -16,39 +16,30 @@
|
|||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL namespace std { namespace experimental {
|
||||
#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL } }
|
||||
#define _VSTD_EXPERIMENTAL std::experimental
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL \
|
||||
namespace std { \
|
||||
namespace experimental {
|
||||
#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL \
|
||||
} \
|
||||
}
|
||||
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_LFTS _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v1 {
|
||||
#define _LIBCPP_END_NAMESPACE_LFTS } } }
|
||||
#define _VSTD_LFTS _VSTD_EXPERIMENTAL::fundamentals_v1
|
||||
#define _LIBCPP_END_NAMESPACE_LFTS \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_LFTS_V2 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v2 {
|
||||
#define _LIBCPP_END_NAMESPACE_LFTS_V2 } } }
|
||||
#define _VSTD_LFTS_V2 _VSTD_EXPERIMENTAL::fundamentals_v2
|
||||
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_LFTS_PMR _LIBCPP_BEGIN_NAMESPACE_LFTS namespace pmr {
|
||||
#define _LIBCPP_END_NAMESPACE_LFTS_PMR _LIBCPP_END_NAMESPACE_LFTS }
|
||||
#define _VSTD_LFTS_PMR _VSTD_LFTS::pmr
|
||||
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD \
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace parallelism_v2 {
|
||||
|
||||
#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD \
|
||||
} _LIBCPP_END_NAMESPACE_EXPERIMENTAL
|
||||
|
||||
#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD_ABI \
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_SIMD namespace simd_abi {
|
||||
|
||||
#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD_ABI \
|
||||
} _LIBCPP_END_NAMESPACE_EXPERIMENTAL_SIMD
|
||||
#define _LIBCPP_END_NAMESPACE_LFTS_V2 \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
// TODO: support more targets
|
||||
#if defined(__AVX__)
|
||||
#define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 32
|
||||
# define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 32
|
||||
#else
|
||||
#define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 16
|
||||
# define _LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES 16
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
120
third_party/libcxx/experimental/__memory
vendored
120
third_party/libcxx/experimental/__memory
vendored
|
@ -1,120 +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 <__type_traits/conditional.h>
|
||||
#include <__type_traits/is_constructible.h>
|
||||
#include <__type_traits/is_convertible.h>
|
||||
#include <__type_traits/is_same.h>
|
||||
#include <experimental/__config>
|
||||
#include <experimental/utility> // for erased_type
|
||||
|
||||
#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_t<
|
||||
__ic_first,
|
||||
false_type,
|
||||
is_constructible<_Tp, _Args..., _Alloc>
|
||||
>::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_t(), __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 */
|
75
third_party/libcxx/experimental/__simd/aligned_tag.h
vendored
Normal file
75
third_party/libcxx/experimental/__simd/aligned_tag.h
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
// -*- 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_ALIGNED_TAG_H
|
||||
#define _LIBCPP_EXPERIMENTAL___SIMD_ALIGNED_TAG_H
|
||||
|
||||
#include <__memory/assume_aligned.h>
|
||||
#include <__type_traits/remove_const.h>
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
#include <experimental/__simd/traits.h>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
|
||||
inline namespace parallelism_v2 {
|
||||
// memory alignment
|
||||
struct element_aligned_tag {
|
||||
template <class _Tp, class _Up = typename _Tp::value_type>
|
||||
static constexpr size_t __alignment = alignof(_Up);
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI constexpr _Up* __apply(_Up* __ptr) {
|
||||
return __ptr;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
inline constexpr bool is_simd_flag_type_v<element_aligned_tag> = true;
|
||||
|
||||
struct vector_aligned_tag {
|
||||
template <class _Tp, class _Up = typename _Tp::value_type>
|
||||
static constexpr size_t __alignment = memory_alignment_v<_Tp, remove_const_t<_Up>>;
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI constexpr _Up* __apply(_Up* __ptr) {
|
||||
return std::__assume_aligned<__alignment<_Tp, _Up>, _Up>(__ptr);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
inline constexpr bool is_simd_flag_type_v<vector_aligned_tag> = true;
|
||||
|
||||
template <size_t _Np>
|
||||
struct overaligned_tag {
|
||||
template <class _Tp, class _Up = typename _Tp::value_type>
|
||||
static constexpr size_t __alignment = _Np;
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI constexpr _Up* __apply(_Up* __ptr) {
|
||||
return std::__assume_aligned<__alignment<_Tp, _Up>, _Up>(__ptr);
|
||||
}
|
||||
};
|
||||
|
||||
template <size_t _Np>
|
||||
inline constexpr bool is_simd_flag_type_v<overaligned_tag<_Np>> = true;
|
||||
|
||||
inline constexpr element_aligned_tag element_aligned{};
|
||||
|
||||
inline constexpr vector_aligned_tag vector_aligned{};
|
||||
|
||||
template <size_t _Np>
|
||||
inline constexpr overaligned_tag<_Np> overaligned{};
|
||||
|
||||
} // namespace parallelism_v2
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
#endif // _LIBCPP_EXPERIMENTAL___SIMD_ALIGNED_TAG_H
|
81
third_party/libcxx/experimental/__simd/declaration.h
vendored
Normal file
81
third_party/libcxx/experimental/__simd/declaration.h
vendored
Normal file
|
@ -0,0 +1,81 @@
|
|||
// -*- 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_DECLARATION_H
|
||||
#define _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
|
||||
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
|
||||
inline namespace parallelism_v2 {
|
||||
namespace simd_abi {
|
||||
template <int>
|
||||
struct __vec_ext;
|
||||
struct __scalar;
|
||||
|
||||
using scalar = __scalar;
|
||||
|
||||
// TODO: make this platform dependent
|
||||
template <int _Np>
|
||||
using fixed_size = __vec_ext<_Np>;
|
||||
|
||||
template <class _Tp>
|
||||
inline constexpr int max_fixed_size = 32;
|
||||
|
||||
// TODO: make this platform dependent
|
||||
template <class _Tp>
|
||||
using compatible = __vec_ext<16 / sizeof(_Tp)>;
|
||||
|
||||
// TODO: make this platform dependent
|
||||
template <class _Tp>
|
||||
using native = __vec_ext<_LIBCPP_NATIVE_SIMD_WIDTH_IN_BYTES / sizeof(_Tp)>;
|
||||
|
||||
// TODO: make this platform dependent
|
||||
template <class _Tp, size_t _Np, class... _Abis>
|
||||
struct deduce {
|
||||
using type = fixed_size<_Np>;
|
||||
};
|
||||
|
||||
// TODO: make this platform dependent
|
||||
template <class _Tp, size_t _Np, class... _Abis>
|
||||
using deduce_t = typename deduce<_Tp, _Np, _Abis...>::type;
|
||||
|
||||
} // namespace simd_abi
|
||||
|
||||
template <class _Tp, class _Abi>
|
||||
struct __simd_storage;
|
||||
|
||||
template <class _Tp, class _Abi>
|
||||
struct __mask_storage;
|
||||
|
||||
template <class _Tp, class _Abi>
|
||||
struct __simd_operations;
|
||||
|
||||
template <class _Tp, class _Abi>
|
||||
struct __mask_operations;
|
||||
|
||||
struct element_aligned_tag;
|
||||
struct vector_aligned_tag;
|
||||
template <size_t>
|
||||
struct overaligned_tag;
|
||||
|
||||
template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>
|
||||
class simd;
|
||||
|
||||
template <class _Tp, class _Abi = simd_abi::compatible<_Tp>>
|
||||
class simd_mask;
|
||||
|
||||
} // namespace parallelism_v2
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
#endif // _LIBCPP_EXPERIMENTAL___SIMD_DECLARATION_H
|
105
third_party/libcxx/experimental/__simd/reference.h
vendored
Normal file
105
third_party/libcxx/experimental/__simd/reference.h
vendored
Normal file
|
@ -0,0 +1,105 @@
|
|||
// -*- 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_REFERENCE_H
|
||||
#define _LIBCPP_EXPERIMENTAL___SIMD_REFERENCE_H
|
||||
|
||||
#include <__type_traits/is_assignable.h>
|
||||
#include <__type_traits/is_same.h>
|
||||
#include <__utility/forward.h>
|
||||
#include <__utility/move.h>
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
#include <experimental/__simd/utility.h>
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
|
||||
inline namespace parallelism_v2 {
|
||||
template <class _Tp, class _Storage, class _Vp>
|
||||
class __simd_reference {
|
||||
template <class, class>
|
||||
friend class simd;
|
||||
template <class, class>
|
||||
friend class simd_mask;
|
||||
|
||||
_Storage& __s_;
|
||||
size_t __idx_;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI __simd_reference(_Storage& __s, size_t __idx) : __s_(__s), __idx_(__idx) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _Vp __get() const noexcept { return __s_.__get(__idx_); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI void __set(_Vp __v) {
|
||||
if constexpr (is_same_v<_Vp, bool>)
|
||||
__s_.__set(__idx_, experimental::__set_all_bits<_Tp>(__v));
|
||||
else
|
||||
__s_.__set(__idx_, __v);
|
||||
}
|
||||
|
||||
public:
|
||||
using value_type = _Vp;
|
||||
|
||||
__simd_reference() = delete;
|
||||
__simd_reference(const __simd_reference&) = delete;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI operator value_type() const noexcept { return __get(); }
|
||||
|
||||
template <class _Up, enable_if_t<is_assignable_v<value_type&, _Up&&>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI __simd_reference operator=(_Up&& __v) && noexcept {
|
||||
__set(static_cast<value_type>(std::forward<_Up>(__v)));
|
||||
return {__s_, __idx_};
|
||||
}
|
||||
|
||||
// Note: This approach might not fully align with the specification,
|
||||
// which might be a wording defect. (https://wg21.link/N4808 section 9.6.3)
|
||||
template <class _Tp1, class _Storage1, class _Vp1>
|
||||
friend void
|
||||
swap(__simd_reference<_Tp1, _Storage1, _Vp1>&& __a, __simd_reference<_Tp1, _Storage1, _Vp1>&& __b) noexcept;
|
||||
|
||||
template <class _Tp1, class _Storage1, class _Vp1>
|
||||
friend void swap(_Vp1& __a, __simd_reference<_Tp1, _Storage1, _Vp1>&& __b) noexcept;
|
||||
|
||||
template <class _Tp1, class _Storage1, class _Vp1>
|
||||
friend void swap(__simd_reference<_Tp1, _Storage1, _Vp1>&& __a, _Vp1& __b) noexcept;
|
||||
};
|
||||
|
||||
template <class _Tp, class _Storage, class _Vp>
|
||||
_LIBCPP_HIDE_FROM_ABI void
|
||||
swap(__simd_reference<_Tp, _Storage, _Vp>&& __a, __simd_reference<_Tp, _Storage, _Vp>&& __b) noexcept {
|
||||
_Vp __tmp(std::move(__a));
|
||||
std::move(__a) = std::move(__b);
|
||||
std::move(__b) = std::move(__tmp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Storage, class _Vp>
|
||||
_LIBCPP_HIDE_FROM_ABI void swap(_Vp& __a, __simd_reference<_Tp, _Storage, _Vp>&& __b) noexcept {
|
||||
_Vp __tmp(std::move(__a));
|
||||
__a = std::move(__b);
|
||||
std::move(__b) = std::move(__tmp);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Storage, class _Vp>
|
||||
_LIBCPP_HIDE_FROM_ABI void swap(__simd_reference<_Tp, _Storage, _Vp>&& __a, _Vp& __b) noexcept {
|
||||
_Vp __tmp(std::move(__a));
|
||||
std::move(__a) = std::move(__b);
|
||||
__b = std::move(__tmp);
|
||||
}
|
||||
|
||||
} // namespace parallelism_v2
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#endif // _LIBCPP_EXPERIMENTAL___SIMD_REFERENCE_H
|
87
third_party/libcxx/experimental/__simd/scalar.h
vendored
Normal file
87
third_party/libcxx/experimental/__simd/scalar.h
vendored
Normal file
|
@ -0,0 +1,87 @@
|
|||
// -*- 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_SCALAR_H
|
||||
#define _LIBCPP_EXPERIMENTAL___SIMD_SCALAR_H
|
||||
|
||||
#include <__assert>
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
#include <experimental/__simd/declaration.h>
|
||||
#include <experimental/__simd/traits.h>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
|
||||
inline namespace parallelism_v2 {
|
||||
namespace simd_abi {
|
||||
struct __scalar {
|
||||
static constexpr size_t __simd_size = 1;
|
||||
};
|
||||
} // namespace simd_abi
|
||||
|
||||
template <>
|
||||
inline constexpr bool is_abi_tag_v<simd_abi::__scalar> = true;
|
||||
|
||||
template <class _Tp>
|
||||
struct __simd_storage<_Tp, simd_abi::__scalar> {
|
||||
_Tp __data;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _Tp __get([[maybe_unused]] size_t __idx) const noexcept {
|
||||
_LIBCPP_ASSERT_UNCATEGORIZED(__idx == 0, "Index is out of bounds");
|
||||
return __data;
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI void __set([[maybe_unused]] size_t __idx, _Tp __v) noexcept {
|
||||
_LIBCPP_ASSERT_UNCATEGORIZED(__idx == 0, "Index is out of bounds");
|
||||
__data = __v;
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct __mask_storage<_Tp, simd_abi::__scalar> : __simd_storage<bool, simd_abi::__scalar> {};
|
||||
|
||||
template <class _Tp>
|
||||
struct __simd_operations<_Tp, simd_abi::__scalar> {
|
||||
using _SimdStorage = __simd_storage<_Tp, simd_abi::__scalar>;
|
||||
using _MaskStorage = __mask_storage<_Tp, simd_abi::__scalar>;
|
||||
|
||||
static _LIBCPP_HIDE_FROM_ABI _SimdStorage __broadcast(_Tp __v) noexcept { return {__v}; }
|
||||
|
||||
template <class _Generator>
|
||||
static _LIBCPP_HIDE_FROM_ABI _SimdStorage __generate(_Generator&& __g) noexcept {
|
||||
return {__g(std::integral_constant<size_t, 0>())};
|
||||
}
|
||||
|
||||
template <class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI void __load(_SimdStorage& __s, const _Up* __mem) noexcept {
|
||||
__s.__data = static_cast<_Tp>(__mem[0]);
|
||||
}
|
||||
|
||||
template <class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI void __store(_SimdStorage __s, _Up* __mem) noexcept {
|
||||
*__mem = static_cast<_Up>(__s.__data);
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
struct __mask_operations<_Tp, simd_abi::__scalar> {
|
||||
using _MaskStorage = __mask_storage<_Tp, simd_abi::__scalar>;
|
||||
|
||||
static _LIBCPP_HIDE_FROM_ABI _MaskStorage __broadcast(bool __v) noexcept { return {__v}; }
|
||||
|
||||
static _LIBCPP_HIDE_FROM_ABI void __load(_MaskStorage& __s, const bool* __mem) noexcept { __s.__data = __mem[0]; }
|
||||
|
||||
static _LIBCPP_HIDE_FROM_ABI void __store(_MaskStorage __s, bool* __mem) noexcept { __mem[0] = __s.__data; }
|
||||
};
|
||||
|
||||
} // namespace parallelism_v2
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
#endif // _LIBCPP_EXPERIMENTAL___SIMD_SCALAR_H
|
102
third_party/libcxx/experimental/__simd/simd.h
vendored
Normal file
102
third_party/libcxx/experimental/__simd/simd.h
vendored
Normal file
|
@ -0,0 +1,102 @@
|
|||
// -*- 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_SIMD_H
|
||||
#define _LIBCPP_EXPERIMENTAL___SIMD_SIMD_H
|
||||
|
||||
#include <__type_traits/is_same.h>
|
||||
#include <__type_traits/remove_cvref.h>
|
||||
#include <__utility/forward.h>
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
#include <experimental/__simd/declaration.h>
|
||||
#include <experimental/__simd/reference.h>
|
||||
#include <experimental/__simd/traits.h>
|
||||
#include <experimental/__simd/utility.h>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
|
||||
inline namespace parallelism_v2 {
|
||||
|
||||
// class template simd [simd.class]
|
||||
// TODO: implement simd class
|
||||
template <class _Tp, class _Abi>
|
||||
class simd {
|
||||
using _Impl = __simd_operations<_Tp, _Abi>;
|
||||
using _Storage = typename _Impl::_SimdStorage;
|
||||
|
||||
_Storage __s_;
|
||||
|
||||
public:
|
||||
using value_type = _Tp;
|
||||
using reference = __simd_reference<_Tp, _Storage, value_type>;
|
||||
using mask_type = simd_mask<_Tp, _Abi>;
|
||||
using abi_type = _Abi;
|
||||
|
||||
static _LIBCPP_HIDE_FROM_ABI constexpr size_t size() noexcept { return simd_size_v<value_type, abi_type>; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI simd() noexcept = default;
|
||||
|
||||
// broadcast constructor
|
||||
template <class _Up, enable_if_t<__can_broadcast_v<value_type, __remove_cvref_t<_Up>>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI simd(_Up&& __v) noexcept : __s_(_Impl::__broadcast(static_cast<value_type>(__v))) {}
|
||||
|
||||
// implicit type conversion constructor
|
||||
template <class _Up,
|
||||
enable_if_t<!is_same_v<_Up, _Tp> && is_same_v<abi_type, simd_abi::fixed_size<size()>> &&
|
||||
__is_non_narrowing_convertible_v<_Up, value_type>,
|
||||
int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI simd(const simd<_Up, simd_abi::fixed_size<size()>>& __v) noexcept {
|
||||
for (size_t __i = 0; __i < size(); __i++) {
|
||||
(*this)[__i] = static_cast<value_type>(__v[__i]);
|
||||
}
|
||||
}
|
||||
|
||||
// generator constructor
|
||||
template <class _Generator, enable_if_t<__can_generate_v<value_type, _Generator, size()>, int> = 0>
|
||||
explicit _LIBCPP_HIDE_FROM_ABI simd(_Generator&& __g) noexcept
|
||||
: __s_(_Impl::__generate(std::forward<_Generator>(__g))) {}
|
||||
|
||||
// load constructor
|
||||
template <class _Up, class _Flags, enable_if_t<__is_vectorizable_v<_Up> && is_simd_flag_type_v<_Flags>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI simd(const _Up* __mem, _Flags) {
|
||||
_Impl::__load(__s_, _Flags::template __apply<simd>(__mem));
|
||||
}
|
||||
|
||||
// copy functions
|
||||
template <class _Up, class _Flags, enable_if_t<__is_vectorizable_v<_Up> && is_simd_flag_type_v<_Flags>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI void copy_from(const _Up* __mem, _Flags) {
|
||||
_Impl::__load(__s_, _Flags::template __apply<simd>(__mem));
|
||||
}
|
||||
|
||||
template <class _Up, class _Flags, enable_if_t<__is_vectorizable_v<_Up> && is_simd_flag_type_v<_Flags>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI void copy_to(_Up* __mem, _Flags) const {
|
||||
_Impl::__store(__s_, _Flags::template __apply<simd>(__mem));
|
||||
}
|
||||
|
||||
// scalar access [simd.subscr]
|
||||
_LIBCPP_HIDE_FROM_ABI reference operator[](size_t __i) noexcept { return reference(__s_, __i); }
|
||||
_LIBCPP_HIDE_FROM_ABI value_type operator[](size_t __i) const noexcept { return __s_.__get(__i); }
|
||||
};
|
||||
|
||||
template <class _Tp, class _Abi>
|
||||
inline constexpr bool is_simd_v<simd<_Tp, _Abi>> = true;
|
||||
|
||||
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>>;
|
||||
|
||||
} // namespace parallelism_v2
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
#endif // _LIBCPP_EXPERIMENTAL___SIMD_SIMD_H
|
90
third_party/libcxx/experimental/__simd/simd_mask.h
vendored
Normal file
90
third_party/libcxx/experimental/__simd/simd_mask.h
vendored
Normal file
|
@ -0,0 +1,90 @@
|
|||
// -*- 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_SIMD_MASK_H
|
||||
#define _LIBCPP_EXPERIMENTAL___SIMD_SIMD_MASK_H
|
||||
|
||||
#include <__type_traits/is_same.h>
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
#include <experimental/__simd/declaration.h>
|
||||
#include <experimental/__simd/reference.h>
|
||||
#include <experimental/__simd/traits.h>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
|
||||
inline namespace parallelism_v2 {
|
||||
|
||||
// class template simd_mask [simd.mask.class]
|
||||
// TODO: implement simd_mask class
|
||||
template <class _Tp, class _Abi>
|
||||
class simd_mask {
|
||||
using _Impl = __mask_operations<_Tp, _Abi>;
|
||||
using _Storage = typename _Impl::_MaskStorage;
|
||||
|
||||
_Storage __s_;
|
||||
|
||||
public:
|
||||
using value_type = bool;
|
||||
using reference = __simd_reference<_Tp, _Storage, value_type>;
|
||||
using simd_type = simd<_Tp, _Abi>;
|
||||
using abi_type = _Abi;
|
||||
|
||||
static _LIBCPP_HIDE_FROM_ABI constexpr size_t size() noexcept { return simd_type::size(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI simd_mask() noexcept = default;
|
||||
|
||||
// broadcast constructor
|
||||
_LIBCPP_HIDE_FROM_ABI explicit simd_mask(value_type __v) noexcept : __s_(_Impl::__broadcast(__v)) {}
|
||||
|
||||
// implicit type conversion constructor
|
||||
template <class _Up, enable_if_t<!is_same_v<_Up, _Tp> && is_same_v<abi_type, simd_abi::fixed_size<size()>>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI simd_mask(const simd_mask<_Up, simd_abi::fixed_size<size()>>& __v) noexcept {
|
||||
for (size_t __i = 0; __i < size(); __i++) {
|
||||
(*this)[__i] = __v[__i];
|
||||
}
|
||||
}
|
||||
|
||||
// load constructor
|
||||
template <class _Flags, enable_if_t<is_simd_flag_type_v<_Flags>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI simd_mask(const value_type* __mem, _Flags) {
|
||||
_Impl::__load(__s_, _Flags::template __apply<simd_mask>(__mem));
|
||||
}
|
||||
|
||||
// copy functions
|
||||
template <class _Flags, enable_if_t<is_simd_flag_type_v<_Flags>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI void copy_from(const value_type* __mem, _Flags) {
|
||||
_Impl::__load(__s_, _Flags::template __apply<simd_mask>(__mem));
|
||||
}
|
||||
|
||||
template <class _Flags, enable_if_t<is_simd_flag_type_v<_Flags>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI void copy_to(value_type* __mem, _Flags) const {
|
||||
_Impl::__store(__s_, _Flags::template __apply<simd_mask>(__mem));
|
||||
}
|
||||
|
||||
// scalar access [simd.mask.subscr]
|
||||
_LIBCPP_HIDE_FROM_ABI reference operator[](size_t __i) noexcept { return reference(__s_, __i); }
|
||||
_LIBCPP_HIDE_FROM_ABI value_type operator[](size_t __i) const noexcept { return __s_.__get(__i); }
|
||||
};
|
||||
|
||||
template <class _Tp, class _Abi>
|
||||
inline constexpr bool is_simd_mask_v<simd_mask<_Tp, _Abi>> = true;
|
||||
|
||||
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>>;
|
||||
|
||||
} // namespace parallelism_v2
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
#endif // _LIBCPP_EXPERIMENTAL___SIMD_SIMD_MASK_H
|
75
third_party/libcxx/experimental/__simd/traits.h
vendored
Normal file
75
third_party/libcxx/experimental/__simd/traits.h
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
// -*- 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_TRAITS_H
|
||||
#define _LIBCPP_EXPERIMENTAL___SIMD_TRAITS_H
|
||||
|
||||
#include <__bit/bit_ceil.h>
|
||||
#include <__type_traits/integral_constant.h>
|
||||
#include <__type_traits/is_same.h>
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
#include <experimental/__simd/declaration.h>
|
||||
#include <experimental/__simd/utility.h>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
|
||||
inline namespace parallelism_v2 {
|
||||
|
||||
// traits [simd.traits]
|
||||
template <class _Tp>
|
||||
inline constexpr bool is_abi_tag_v = false;
|
||||
|
||||
template <class _Tp>
|
||||
struct is_abi_tag : bool_constant<is_abi_tag_v<_Tp>> {};
|
||||
|
||||
template <class _Tp>
|
||||
inline constexpr bool is_simd_v = false;
|
||||
|
||||
template <class _Tp>
|
||||
struct is_simd : bool_constant<is_simd_v<_Tp>> {};
|
||||
|
||||
template <class _Tp>
|
||||
inline constexpr bool is_simd_mask_v = false;
|
||||
|
||||
template <class _Tp>
|
||||
struct is_simd_mask : bool_constant<is_simd_mask_v<_Tp>> {};
|
||||
|
||||
template <class _Tp>
|
||||
inline constexpr bool is_simd_flag_type_v = false;
|
||||
|
||||
template <class _Tp>
|
||||
struct is_simd_flag_type : bool_constant<is_simd_flag_type_v<_Tp>> {};
|
||||
|
||||
template <class _Tp, class _Abi = simd_abi::compatible<_Tp>, bool = (__is_vectorizable_v<_Tp> && is_abi_tag_v<_Abi>)>
|
||||
struct simd_size : integral_constant<size_t, _Abi::__simd_size> {};
|
||||
|
||||
template <class _Tp, class _Abi>
|
||||
struct simd_size<_Tp, _Abi, false> {};
|
||||
|
||||
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,
|
||||
bool = (is_simd_v<_Tp> && __is_vectorizable_v<_Up>) || (is_simd_mask_v<_Tp> && is_same_v<_Up, bool>)>
|
||||
struct memory_alignment : integral_constant<size_t, std::__bit_ceil(sizeof(_Up) * _Tp::size())> {};
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
struct memory_alignment<_Tp, _Up, false> {};
|
||||
|
||||
template <class _Tp, class _Up = typename _Tp::value_type>
|
||||
inline constexpr size_t memory_alignment_v = memory_alignment<_Tp, _Up>::value;
|
||||
|
||||
} // namespace parallelism_v2
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
#endif // _LIBCPP_EXPERIMENTAL___SIMD_TRAITS_H
|
103
third_party/libcxx/experimental/__simd/utility.h
vendored
Normal file
103
third_party/libcxx/experimental/__simd/utility.h
vendored
Normal file
|
@ -0,0 +1,103 @@
|
|||
// -*- 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_UTILITY_H
|
||||
#define _LIBCPP_EXPERIMENTAL___SIMD_UTILITY_H
|
||||
|
||||
#include <__type_traits/is_arithmetic.h>
|
||||
#include <__type_traits/is_const.h>
|
||||
#include <__type_traits/is_constant_evaluated.h>
|
||||
#include <__type_traits/is_convertible.h>
|
||||
#include <__type_traits/is_same.h>
|
||||
#include <__type_traits/is_unsigned.h>
|
||||
#include <__type_traits/is_volatile.h>
|
||||
#include <__type_traits/void_t.h>
|
||||
#include <__utility/declval.h>
|
||||
#include <__utility/integer_sequence.h>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <experimental/__config>
|
||||
#include <limits>
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
|
||||
inline namespace parallelism_v2 {
|
||||
template <class _Tp>
|
||||
inline constexpr bool __is_vectorizable_v =
|
||||
is_arithmetic_v<_Tp> && !is_const_v<_Tp> && !is_volatile_v<_Tp> && !is_same_v<_Tp, bool>;
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI auto __choose_mask_type() {
|
||||
if constexpr (sizeof(_Tp) == 1) {
|
||||
return uint8_t{};
|
||||
} else if constexpr (sizeof(_Tp) == 2) {
|
||||
return uint16_t{};
|
||||
} else if constexpr (sizeof(_Tp) == 4) {
|
||||
return uint32_t{};
|
||||
} else if constexpr (sizeof(_Tp) == 8) {
|
||||
return uint64_t{};
|
||||
}
|
||||
# ifndef _LIBCPP_HAS_NO_INT128
|
||||
else if constexpr (sizeof(_Tp) == 16) {
|
||||
return __uint128_t{};
|
||||
}
|
||||
# endif
|
||||
else
|
||||
static_assert(sizeof(_Tp) == 0, "Unexpected size");
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI auto constexpr __set_all_bits(bool __v) {
|
||||
return __v ? (numeric_limits<decltype(__choose_mask_type<_Tp>())>::max()) : 0;
|
||||
}
|
||||
|
||||
template <class _From, class _To, class = void>
|
||||
inline constexpr bool __is_non_narrowing_convertible_v = false;
|
||||
|
||||
template <class _From, class _To>
|
||||
inline constexpr bool __is_non_narrowing_convertible_v<_From, _To, std::void_t<decltype(_To{std::declval<_From>()})>> =
|
||||
true;
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
inline constexpr bool __can_broadcast_v =
|
||||
(__is_vectorizable_v<_Up> && __is_non_narrowing_convertible_v<_Up, _Tp>) ||
|
||||
(!__is_vectorizable_v<_Up> && is_convertible_v<_Up, _Tp>) || is_same_v<_Up, int> ||
|
||||
(is_same_v<_Up, unsigned int> && is_unsigned_v<_Tp>);
|
||||
|
||||
template <class _Tp, class _Generator, std::size_t _Idx, class = void>
|
||||
inline constexpr bool __is_well_formed = false;
|
||||
|
||||
template <class _Tp, class _Generator, std::size_t _Idx>
|
||||
inline constexpr bool
|
||||
__is_well_formed<_Tp,
|
||||
_Generator,
|
||||
_Idx,
|
||||
std::void_t<decltype(std::declval<_Generator>()(integral_constant<size_t, _Idx>()))>> =
|
||||
__can_broadcast_v<_Tp, decltype(std::declval<_Generator>()(integral_constant<size_t, _Idx>()))>;
|
||||
|
||||
template <class _Tp, class _Generator, std::size_t... _Idxes>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool __can_generate(index_sequence<_Idxes...>) {
|
||||
return (true && ... && __is_well_formed<_Tp, _Generator, _Idxes>);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Generator, std::size_t _Size>
|
||||
inline constexpr bool __can_generate_v = experimental::__can_generate<_Tp, _Generator>(make_index_sequence<_Size>());
|
||||
|
||||
} // namespace parallelism_v2
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#endif // _LIBCPP_EXPERIMENTAL___SIMD_UTILITY_H
|
119
third_party/libcxx/experimental/__simd/vec_ext.h
vendored
Normal file
119
third_party/libcxx/experimental/__simd/vec_ext.h
vendored
Normal file
|
@ -0,0 +1,119 @@
|
|||
// -*- 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_VEC_EXT_H
|
||||
#define _LIBCPP_EXPERIMENTAL___SIMD_VEC_EXT_H
|
||||
|
||||
#include <__assert>
|
||||
#include <__bit/bit_ceil.h>
|
||||
#include <__utility/forward.h>
|
||||
#include <__utility/integer_sequence.h>
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
#include <experimental/__simd/declaration.h>
|
||||
#include <experimental/__simd/traits.h>
|
||||
#include <experimental/__simd/utility.h>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
|
||||
inline namespace parallelism_v2 {
|
||||
namespace simd_abi {
|
||||
template <int _Np>
|
||||
struct __vec_ext {
|
||||
static constexpr size_t __simd_size = _Np;
|
||||
};
|
||||
} // namespace simd_abi
|
||||
|
||||
template <int _Np>
|
||||
inline constexpr bool is_abi_tag_v<simd_abi::__vec_ext<_Np>> = _Np > 0 && _Np <= 32;
|
||||
|
||||
template <class _Tp, int _Np>
|
||||
struct __simd_storage<_Tp, simd_abi::__vec_ext<_Np>> {
|
||||
_Tp __data __attribute__((__vector_size__(std::__bit_ceil((sizeof(_Tp) * _Np)))));
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _Tp __get(size_t __idx) const noexcept {
|
||||
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx >= 0 && __idx < _Np, "Index is out of bounds");
|
||||
return __data[__idx];
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI void __set(size_t __idx, _Tp __v) noexcept {
|
||||
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__idx >= 0 && __idx < _Np, "Index is out of bounds");
|
||||
__data[__idx] = __v;
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Tp, int _Np>
|
||||
struct __mask_storage<_Tp, simd_abi::__vec_ext<_Np>>
|
||||
: __simd_storage<decltype(experimental::__choose_mask_type<_Tp>()), simd_abi::__vec_ext<_Np>> {};
|
||||
|
||||
template <class _Tp, int _Np>
|
||||
struct __simd_operations<_Tp, simd_abi::__vec_ext<_Np>> {
|
||||
using _SimdStorage = __simd_storage<_Tp, simd_abi::__vec_ext<_Np>>;
|
||||
using _MaskStorage = __mask_storage<_Tp, simd_abi::__vec_ext<_Np>>;
|
||||
|
||||
static _LIBCPP_HIDE_FROM_ABI _SimdStorage __broadcast(_Tp __v) noexcept {
|
||||
_SimdStorage __result;
|
||||
for (int __i = 0; __i < _Np; ++__i) {
|
||||
__result.__set(__i, __v);
|
||||
}
|
||||
return __result;
|
||||
}
|
||||
|
||||
template <class _Generator, size_t... _Is>
|
||||
static _LIBCPP_HIDE_FROM_ABI _SimdStorage __generate_init(_Generator&& __g, std::index_sequence<_Is...>) {
|
||||
return _SimdStorage{{__g(std::integral_constant<size_t, _Is>())...}};
|
||||
}
|
||||
|
||||
template <class _Generator>
|
||||
static _LIBCPP_HIDE_FROM_ABI _SimdStorage __generate(_Generator&& __g) noexcept {
|
||||
return __generate_init(std::forward<_Generator>(__g), std::make_index_sequence<_Np>());
|
||||
}
|
||||
|
||||
template <class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI void __load(_SimdStorage& __s, const _Up* __mem) noexcept {
|
||||
for (size_t __i = 0; __i < _Np; __i++)
|
||||
__s.__data[__i] = static_cast<_Tp>(__mem[__i]);
|
||||
}
|
||||
|
||||
template <class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI void __store(_SimdStorage __s, _Up* __mem) noexcept {
|
||||
for (size_t __i = 0; __i < _Np; __i++)
|
||||
__mem[__i] = static_cast<_Up>(__s.__data[__i]);
|
||||
}
|
||||
};
|
||||
|
||||
template <class _Tp, int _Np>
|
||||
struct __mask_operations<_Tp, simd_abi::__vec_ext<_Np>> {
|
||||
using _MaskStorage = __mask_storage<_Tp, simd_abi::__vec_ext<_Np>>;
|
||||
|
||||
static _LIBCPP_HIDE_FROM_ABI _MaskStorage __broadcast(bool __v) noexcept {
|
||||
_MaskStorage __result;
|
||||
auto __all_bits_v = experimental::__set_all_bits<_Tp>(__v);
|
||||
for (int __i = 0; __i < _Np; ++__i) {
|
||||
__result.__set(__i, __all_bits_v);
|
||||
}
|
||||
return __result;
|
||||
}
|
||||
|
||||
static _LIBCPP_HIDE_FROM_ABI void __load(_MaskStorage& __s, const bool* __mem) noexcept {
|
||||
for (size_t __i = 0; __i < _Np; __i++)
|
||||
__s.__data[__i] = experimental::__set_all_bits<_Tp>(__mem[__i]);
|
||||
}
|
||||
|
||||
static _LIBCPP_HIDE_FROM_ABI void __store(_MaskStorage __s, bool* __mem) noexcept {
|
||||
for (size_t __i = 0; __i < _Np; __i++)
|
||||
__mem[__i] = static_cast<bool>(__s.__data[__i]);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace parallelism_v2
|
||||
_LIBCPP_END_NAMESPACE_EXPERIMENTAL
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 17 && defined(_LIBCPP_ENABLE_EXPERIMENTAL)
|
||||
#endif // _LIBCPP_EXPERIMENTAL___SIMD_VEC_EXT_H
|
52
third_party/libcxx/experimental/deque
vendored
52
third_party/libcxx/experimental/deque
vendored
|
@ -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_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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#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
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
template <class _ValueT>
|
||||
using deque = _VSTD::deque<_ValueT, polymorphic_allocator<_ValueT>>;
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_DEQUE */
|
52
third_party/libcxx/experimental/forward_list
vendored
52
third_party/libcxx/experimental/forward_list
vendored
|
@ -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_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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#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
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
template <class _ValueT>
|
||||
using forward_list = _VSTD::forward_list<_ValueT, polymorphic_allocator<_ValueT>>;
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_FORWARD_LIST */
|
69
third_party/libcxx/experimental/iterator
vendored
69
third_party/libcxx/experimental/iterator
vendored
|
@ -52,19 +52,20 @@ namespace std {
|
|||
|
||||
*/
|
||||
|
||||
#include <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <__memory/addressof.h>
|
||||
#include <__type_traits/decay.h>
|
||||
#include <__utility/forward.h>
|
||||
#include <__utility/move.h>
|
||||
#include <experimental/__config>
|
||||
#include <iosfwd> // char_traits
|
||||
#include <iterator>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_LFTS
|
||||
|
@ -72,54 +73,54 @@ _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;
|
||||
|
||||
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;
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner(ostream_type& __os, _Delim&& __d)
|
||||
: __output_iter_(std::addressof(__os)), __delim_(std::move(__d)), __first_(true) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner(ostream_type& __os, _Delim&& __d)
|
||||
: __output_iter_(_VSTD::addressof(__os)), __delim_(_VSTD::move(__d)), __first_(true) {}
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner(ostream_type& __os, const _Delim& __d)
|
||||
: __output_iter_(std::addressof(__os)), __delim_(__d), __first_(true) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner(ostream_type& __os, const _Delim& __d)
|
||||
: __output_iter_(_VSTD::addressof(__os)), __delim_(__d), __first_(true) {}
|
||||
template <typename _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner& operator=(const _Tp& __v) {
|
||||
if (!__first_)
|
||||
*__output_iter_ << __delim_;
|
||||
__first_ = false;
|
||||
*__output_iter_ << __v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
template<typename _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner& operator=(const _Tp& __v)
|
||||
{
|
||||
if (!__first_)
|
||||
*__output_iter_ << __delim_;
|
||||
__first_ = false;
|
||||
*__output_iter_ << __v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner& operator*() _NOEXCEPT { return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner& operator++() _NOEXCEPT { return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner& operator++(int) _NOEXCEPT { return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner& operator*() _NOEXCEPT { return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner& operator++() _NOEXCEPT { return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner& operator++(int) _NOEXCEPT { return *this; }
|
||||
|
||||
private:
|
||||
ostream_type* __output_iter_;
|
||||
_Delim __delim_;
|
||||
bool __first_;
|
||||
ostream_type* __output_iter_;
|
||||
_Delim __delim_;
|
||||
bool __first_;
|
||||
};
|
||||
|
||||
|
||||
template <class _CharT, class _Traits, class _Delim>
|
||||
_LIBCPP_HIDE_FROM_ABI ostream_joiner<__decay_t<_Delim>, _CharT, _Traits>
|
||||
make_ostream_joiner(basic_ostream<_CharT, _Traits>& __os, _Delim && __d)
|
||||
{ return ostream_joiner<__decay_t<_Delim>, _CharT, _Traits>(__os, _VSTD::forward<_Delim>(__d)); }
|
||||
make_ostream_joiner(basic_ostream<_CharT, _Traits>& __os, _Delim&& __d) {
|
||||
return ostream_joiner<__decay_t<_Delim>, _CharT, _Traits>(__os, std::forward<_Delim>(__d));
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 14
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
|
||||
# include <iosfwd>
|
||||
# include <type_traits>
|
||||
#endif
|
||||
|
||||
|
|
52
third_party/libcxx/experimental/list
vendored
52
third_party/libcxx/experimental/list
vendored
|
@ -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_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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#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
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
template <class _ValueT>
|
||||
using list = _VSTD::list<_ValueT, polymorphic_allocator<_ValueT>>;
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_LIST */
|
62
third_party/libcxx/experimental/map
vendored
62
third_party/libcxx/experimental/map
vendored
|
@ -1,62 +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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#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
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
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>>>;
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_MAP */
|
198
third_party/libcxx/experimental/memory
vendored
Normal file
198
third_party/libcxx/experimental/memory
vendored
Normal file
|
@ -0,0 +1,198 @@
|
|||
// -*- 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
|
||||
|
||||
/*
|
||||
experimental/memory synopsis
|
||||
|
||||
namespace std::experimental::inline fundamentals_v2 {
|
||||
|
||||
template <class W> class observer_ptr {
|
||||
public:
|
||||
using element_type = W;
|
||||
using pointer = add_pointer_t<W>; // exposition-only
|
||||
using reference = add_lvalue_reference_t<W>; // exposition-only
|
||||
|
||||
// default ctor
|
||||
constexpr observer_ptr() noexcept;
|
||||
|
||||
// pointer-accepting ctors
|
||||
constexpr observer_ptr(nullptr_t) noexcept;
|
||||
constexpr explicit observer_ptr(pointer) noexcept;
|
||||
|
||||
// copying ctors (in addition to compiler-generated copy ctor)
|
||||
template <class W2> constexpr observer_ptr(observer_ptr<W2>) noexcept;
|
||||
|
||||
// observers
|
||||
constexpr pointer get() const noexcept;
|
||||
constexpr reference operator*() const;
|
||||
constexpr pointer operator->() const noexcept;
|
||||
constexpr explicit operator bool() const noexcept;
|
||||
|
||||
// conversions
|
||||
constexpr explicit operator pointer() const noexcept;
|
||||
|
||||
// modifiers
|
||||
constexpr pointer release() noexcept;
|
||||
constexpr void reset(pointer = nullptr) noexcept;
|
||||
constexpr void swap(observer_ptr&) noexcept;
|
||||
};
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
#include <__functional/hash.h>
|
||||
#include <__functional/operations.h>
|
||||
#include <__type_traits/add_lvalue_reference.h>
|
||||
#include <__type_traits/add_pointer.h>
|
||||
#include <__type_traits/common_type.h>
|
||||
#include <__type_traits/enable_if.h>
|
||||
#include <__type_traits/is_convertible.h>
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef _LIBCPP_ENABLE_EXPERIMENTAL
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
|
||||
|
||||
# if _LIBCPP_STD_VER >= 17
|
||||
|
||||
template <class _Wp>
|
||||
class observer_ptr {
|
||||
public:
|
||||
using element_type = _Wp;
|
||||
|
||||
// constructors
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr observer_ptr() noexcept : __ptr_(nullptr) {}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr observer_ptr(nullptr_t) noexcept : __ptr_(nullptr) {}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr explicit observer_ptr(element_type* __p) noexcept : __ptr_(__p) {}
|
||||
|
||||
template <class _W2, __enable_if_t<is_convertible<_W2*, _Wp*>::value, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr observer_ptr(observer_ptr<_W2> __other) noexcept : __ptr_(__other.get()) {}
|
||||
|
||||
// observers
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr element_type* get() const noexcept { return __ptr_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr add_lvalue_reference_t<_Wp> operator*() const { return *__ptr_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr element_type* operator->() const noexcept { return __ptr_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr explicit operator bool() const noexcept { return __ptr_ != nullptr; }
|
||||
|
||||
// conversions
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr explicit operator element_type*() const noexcept { return __ptr_; }
|
||||
|
||||
// modifiers
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr void reset(element_type* __p = nullptr) noexcept { __ptr_ = __p; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr void swap(observer_ptr& __other) noexcept {
|
||||
observer_ptr __tmp = __other;
|
||||
__other = *this;
|
||||
*this = __tmp;
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr element_type* release() noexcept {
|
||||
observer_ptr __p;
|
||||
__p.swap(*this);
|
||||
return __p.get();
|
||||
}
|
||||
|
||||
private:
|
||||
element_type* __ptr_;
|
||||
};
|
||||
|
||||
// specializations
|
||||
|
||||
template <class _Wp>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr void swap(observer_ptr<_Wp>& __a, observer_ptr<_Wp>& __b) noexcept {
|
||||
__a.swap(__b);
|
||||
}
|
||||
|
||||
template <class _Wp>
|
||||
_LIBCPP_HIDE_FROM_ABI observer_ptr<_Wp> make_observer(_Wp* __ptr) noexcept {
|
||||
return observer_ptr<_Wp>{__ptr};
|
||||
}
|
||||
|
||||
template <class _W1, class _W2>
|
||||
_LIBCPP_HIDE_FROM_ABI bool operator==(observer_ptr<_W1> __a, observer_ptr<_W2> __b) {
|
||||
return __a.get() == __b.get();
|
||||
}
|
||||
|
||||
template <class _W1, class _W2>
|
||||
_LIBCPP_HIDE_FROM_ABI bool operator!=(observer_ptr<_W1> __a, observer_ptr<_W2> __b) {
|
||||
return !(__a == __b);
|
||||
}
|
||||
|
||||
template <class _Wp>
|
||||
_LIBCPP_HIDE_FROM_ABI bool operator==(observer_ptr<_Wp> __p, nullptr_t) {
|
||||
return !__p;
|
||||
}
|
||||
|
||||
template <class _Wp>
|
||||
_LIBCPP_HIDE_FROM_ABI bool operator==(nullptr_t, observer_ptr<_Wp> __p) {
|
||||
return !__p;
|
||||
}
|
||||
|
||||
template <class _Wp>
|
||||
_LIBCPP_HIDE_FROM_ABI bool operator!=(observer_ptr<_Wp> __p, nullptr_t) {
|
||||
return (bool)__p;
|
||||
}
|
||||
|
||||
template <class _Wp>
|
||||
_LIBCPP_HIDE_FROM_ABI bool operator!=(nullptr_t, observer_ptr<_Wp> __p) {
|
||||
return (bool)__p;
|
||||
}
|
||||
|
||||
template <class _W1, class _W2>
|
||||
_LIBCPP_HIDE_FROM_ABI bool operator<(observer_ptr<_W1> __a, observer_ptr<_W2> __b) {
|
||||
return std::less<typename std::common_type<_W1*, _W2*>::type>()(__a.get(), __b.get());
|
||||
}
|
||||
|
||||
template <class _W1, class _W2>
|
||||
_LIBCPP_HIDE_FROM_ABI bool operator>(observer_ptr<_W1> __a, observer_ptr<_W2> __b) {
|
||||
return __b < __a;
|
||||
}
|
||||
|
||||
template <class _W1, class _W2>
|
||||
_LIBCPP_HIDE_FROM_ABI bool operator<=(observer_ptr<_W1> __a, observer_ptr<_W2> __b) {
|
||||
return !(__a > __b);
|
||||
}
|
||||
|
||||
template <class _W1, class _W2>
|
||||
_LIBCPP_HIDE_FROM_ABI bool operator>=(observer_ptr<_W1> __a, observer_ptr<_W2> __b) {
|
||||
return !(__a < __b);
|
||||
}
|
||||
|
||||
# endif // _LIBCPP_STD_VER >= 17
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_V2
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
// hash
|
||||
|
||||
# if _LIBCPP_STD_VER >= 17
|
||||
template <class _Tp>
|
||||
struct hash<experimental::observer_ptr<_Tp>> {
|
||||
_LIBCPP_HIDE_FROM_ABI size_t operator()(const experimental::observer_ptr<_Tp>& __ptr) const noexcept {
|
||||
return hash<_Tp*>()(__ptr.get());
|
||||
}
|
||||
};
|
||||
# endif // _LIBCPP_STD_VER >= 17
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_ENABLE_EXPERIMENTAL
|
||||
|
||||
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
|
||||
# include <limits>
|
||||
#endif
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_MEMORY */
|
444
third_party/libcxx/experimental/memory_resource
vendored
444
third_party/libcxx/experimental/memory_resource
vendored
|
@ -1,444 +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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <__memory/allocator_traits.h>
|
||||
#include <__type_traits/aligned_storage.h>
|
||||
#include <__utility/move.h>
|
||||
#include <cstddef>
|
||||
#include <experimental/__config>
|
||||
#include <experimental/__memory>
|
||||
#include <limits>
|
||||
#include <new>
|
||||
#include <stdexcept>
|
||||
#include <tuple>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
|
||||
|
||||
#define _LIBCPP_DEPCREATED_MEMORY_RESOURCE(name) \
|
||||
_LIBCPP_DEPRECATED_("'std::experimental::pmr::" name \
|
||||
"' is deprecated and will be removed in LLVM 18. Use 'std::pmr::" name "' instead.")
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
// 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_DEPCREATED_MEMORY_RESOURCE("memory_resource") _LIBCPP_TYPE_VIS memory_resource
|
||||
{
|
||||
static const size_t __max_align = _LIBCPP_ALIGNOF(max_align_t);
|
||||
|
||||
// 8.5.2, memory.resource.public
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI_VIRTUAL 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
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("operator==(memory_resource, memory_resource)") inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(memory_resource const & __lhs,
|
||||
memory_resource const & __rhs) _NOEXCEPT
|
||||
{
|
||||
return &__lhs == &__rhs || __lhs.is_equal(__rhs);
|
||||
}
|
||||
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("operator!=(memory_resource, memory_resource)") inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(memory_resource const & __lhs,
|
||||
memory_resource const & __rhs) _NOEXCEPT
|
||||
{
|
||||
return !(__lhs == __rhs);
|
||||
}
|
||||
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("new_delete_resource()") _LIBCPP_FUNC_VIS
|
||||
memory_resource * new_delete_resource() _NOEXCEPT;
|
||||
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("null_memory_resource()") _LIBCPP_FUNC_VIS
|
||||
memory_resource * null_memory_resource() _NOEXCEPT;
|
||||
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("get_default_resource()") _LIBCPP_FUNC_VIS
|
||||
memory_resource * get_default_resource() _NOEXCEPT;
|
||||
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("set_default_resource()") _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_DEPCREATED_MEMORY_RESOURCE("polymorphic_allocator") _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)
|
||||
{}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI 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>
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("operator==(const polymorphic_allocator&, const polymorphic_allocator&)")
|
||||
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>
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("operator!=(const polymorphic_allocator&, const polymorphic_allocator&)")
|
||||
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
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
// 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;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI __resource_adaptor_imp() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI __resource_adaptor_imp(__resource_adaptor_imp const &) = default;
|
||||
_LIBCPP_HIDE_FROM_ABI __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))
|
||||
{}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI __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:
|
||||
_LIBCPP_HIDE_FROM_ABI_VIRTUAL void * do_allocate(size_t __bytes, size_t) override
|
||||
{
|
||||
if (__bytes > __max_size())
|
||||
__throw_bad_array_new_length();
|
||||
size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign;
|
||||
return __alloc_.allocate(__s);
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI_VIRTUAL void do_deallocate(void * __p, size_t __bytes, size_t) override
|
||||
{
|
||||
_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);
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI_VIRTUAL bool do_is_equal(memory_resource const & __other) const _NOEXCEPT override {
|
||||
__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_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
|
||||
# include <atomic>
|
||||
# include <climits>
|
||||
# include <concepts>
|
||||
# include <cstdlib>
|
||||
# include <cstring>
|
||||
# include <ctime>
|
||||
# include <iterator>
|
||||
# include <memory>
|
||||
# include <ratio>
|
||||
# include <type_traits>
|
||||
# include <variant>
|
||||
#endif
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE */
|
437
third_party/libcxx/experimental/propagate_const
vendored
437
third_party/libcxx/experimental/propagate_const
vendored
|
@ -19,8 +19,8 @@
|
|||
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;
|
||||
constexpr const _Tp& get_underlying(const propagate_const<T>& pt) noexcept;
|
||||
constexpr T& 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);
|
||||
|
@ -93,23 +93,22 @@
|
|||
} // namespace experimental
|
||||
|
||||
// [propagate_const.hash], hash support
|
||||
template <class T> struct hash<experimental::fundamentals_v2::propagate_const<T>>;
|
||||
template <class T> struct hash<experimental::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>>;
|
||||
template <class T> struct equal_to<experimental::propagate_const<T>>;
|
||||
template <class T> struct not_equal_to<experimental::propagate_const<T>>;
|
||||
template <class T> struct less<experimental::propagate_const<T>>;
|
||||
template <class T> struct greater<experimental::propagate_const<T>>;
|
||||
template <class T> struct less_equal<experimental::propagate_const<T>>;
|
||||
template <class T> struct greater_equal<experimental::propagate_const<T>>;
|
||||
|
||||
} // namespace std
|
||||
|
||||
*/
|
||||
|
||||
#include <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <__functional/operations.h>
|
||||
#include <__fwd/hash.h>
|
||||
#include <__fwd/functional.h>
|
||||
#include <__type_traits/conditional.h>
|
||||
#include <__type_traits/decay.h>
|
||||
#include <__type_traits/enable_if.h>
|
||||
|
@ -135,6 +134,9 @@
|
|||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_LFTS_V2
|
||||
|
@ -143,356 +145,255 @@ 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;
|
||||
inline _LIBCPP_HIDE_FROM_ABI 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;
|
||||
inline _LIBCPP_HIDE_FROM_ABI constexpr _Up& get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
|
||||
|
||||
template <class _Tp>
|
||||
class propagate_const
|
||||
{
|
||||
class propagate_const {
|
||||
public:
|
||||
typedef remove_reference_t<decltype(*std::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_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<__remove_pointer_t<_Tp> >::value),
|
||||
"Instantiation of propagate_const with a function-pointer type is ill-formed.");
|
||||
"Instantiation of propagate_const with a function-pointer type is ill-formed.");
|
||||
static_assert(!(is_pointer<_Tp>::value && is_same<__remove_cv_t<__remove_pointer_t<_Tp> >, void>::value),
|
||||
"Instantiation of propagate_const with a pointer to (possibly cv-qualified) void is ill-formed.");
|
||||
"Instantiation of propagate_const with a pointer to (possibly cv-qualified) void is ill-formed.");
|
||||
|
||||
private:
|
||||
template <class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up* __u)
|
||||
{
|
||||
static _LIBCPP_HIDE_FROM_ABI constexpr element_type* __get_pointer(_Up* __u) {
|
||||
return __u;
|
||||
}
|
||||
|
||||
template <class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* __get_pointer(_Up& __u)
|
||||
{
|
||||
static _LIBCPP_HIDE_FROM_ABI constexpr element_type* __get_pointer(_Up& __u) {
|
||||
return __get_pointer(__u.get());
|
||||
}
|
||||
|
||||
template <class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up* __u)
|
||||
{
|
||||
static _LIBCPP_HIDE_FROM_ABI constexpr const element_type* __get_pointer(const _Up* __u) {
|
||||
return __u;
|
||||
}
|
||||
|
||||
template <class _Up>
|
||||
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* __get_pointer(const _Up& __u)
|
||||
{
|
||||
static _LIBCPP_HIDE_FROM_ABI constexpr const element_type* __get_pointer(const _Up& __u) {
|
||||
return __get_pointer(__u.get());
|
||||
}
|
||||
|
||||
template <class _Up>
|
||||
struct __is_propagate_const : false_type
|
||||
{
|
||||
};
|
||||
struct __is_propagate_const : false_type {};
|
||||
|
||||
template <class _Up>
|
||||
struct __is_propagate_const<propagate_const<_Up>> : true_type
|
||||
{
|
||||
};
|
||||
struct __is_propagate_const<propagate_const<_Up>> : true_type {};
|
||||
|
||||
_Tp __t_;
|
||||
|
||||
public:
|
||||
template <class _Up>
|
||||
friend constexpr const _Up& experimental::fundamentals_v2::get_underlying(const propagate_const<_Up>& __pu) _NOEXCEPT;
|
||||
template <class _Up>
|
||||
friend constexpr _Up& experimental::fundamentals_v2::get_underlying(propagate_const<_Up>& __pu) _NOEXCEPT;
|
||||
|
||||
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_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr propagate_const() = default;
|
||||
|
||||
propagate_const(const propagate_const&) = delete;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const(propagate_const&&) = default;
|
||||
_LIBCPP_HIDE_FROM_ABI 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_HIDE_FROM_ABI _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> = true>
|
||||
explicit _LIBCPP_HIDE_FROM_ABI constexpr propagate_const(propagate_const<_Up>&& __pu)
|
||||
: __t_(std::move(experimental::get_underlying(__pu))) {}
|
||||
|
||||
template <class _Up, enable_if_t<is_convertible<_Up&&, _Tp>::value &&
|
||||
is_constructible<_Tp, _Up&&>::value,bool> = false>
|
||||
_LIBCPP_HIDE_FROM_ABI _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_HIDE_FROM_ABI constexpr propagate_const(propagate_const<_Up>&& __pu)
|
||||
: __t_(std::move(experimental::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_HIDE_FROM_ABI _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> = true>
|
||||
explicit _LIBCPP_HIDE_FROM_ABI 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_HIDE_FROM_ABI _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_HIDE_FROM_ABI constexpr propagate_const(_Up&& __u) : __t_(std::forward<_Up>(__u)) {}
|
||||
|
||||
propagate_const& operator=(const propagate_const&) = delete;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const&&) = default;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr propagate_const& operator=(propagate_const&&) = default;
|
||||
|
||||
template <class _Up>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(propagate_const<_Up>&& __pu)
|
||||
{
|
||||
__t_ = std::move(_VSTD_LFTS_V2::get_underlying(__pu));
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr propagate_const& operator=(propagate_const<_Up>&& __pu) {
|
||||
__t_ = std::move(experimental::get_underlying(__pu));
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class _Up, class _Vp = enable_if_t<!__is_propagate_const<decay_t<_Up>>::value>>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR propagate_const& operator=(_Up&& __u)
|
||||
{
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr propagate_const& operator=(_Up&& __u) {
|
||||
__t_ = std::forward<_Up>(__u);
|
||||
return *this;
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* get() const
|
||||
{
|
||||
return __get_pointer(__t_);
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr const element_type* get() const { return __get_pointer(__t_); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* get()
|
||||
{
|
||||
return __get_pointer(__t_);
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr element_type* get() { return __get_pointer(__t_); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI explicit _LIBCPP_CONSTEXPR operator bool() const
|
||||
{
|
||||
return get() != nullptr;
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI explicit constexpr operator bool() const { return get() != nullptr; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type* operator->() const
|
||||
{
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr const element_type* operator->() const { return get(); }
|
||||
|
||||
template <class _Dummy = _Tp, class _Up = enable_if_t<is_convertible< const _Dummy, const element_type*>::value>>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr operator const element_type*() const {
|
||||
return get();
|
||||
}
|
||||
|
||||
template <class _Tp_ = _Tp, class _Up = enable_if_t<is_convertible<
|
||||
const _Tp_, const element_type *>::value>>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator const element_type *() const {
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr const element_type& operator*() const { return *get(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr element_type* operator->() { return get(); }
|
||||
|
||||
template <class _Dummy = _Tp, class _Up = enable_if_t< is_convertible<_Dummy, element_type*>::value>>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr operator element_type*() {
|
||||
return get();
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR const element_type& operator*() const
|
||||
{
|
||||
return *get();
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr element_type& operator*() { return *get(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type* operator->()
|
||||
{
|
||||
return get();
|
||||
}
|
||||
|
||||
template <class _Tp_ = _Tp, class _Up = enable_if_t<
|
||||
is_convertible<_Tp_, element_type *>::value>>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR operator element_type *() {
|
||||
return get();
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR element_type& operator*()
|
||||
{
|
||||
return *get();
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR void swap(propagate_const& __pt)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value) {
|
||||
using _VSTD::swap;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr void swap(propagate_const& __pt) noexcept(__is_nothrow_swappable_v<_Tp>) {
|
||||
using std::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;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const propagate_const<_Tp>& __pt, nullptr_t) {
|
||||
return experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(nullptr_t, const propagate_const<_Tp>& __pt) {
|
||||
return nullptr == experimental::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;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const propagate_const<_Tp>& __pt, nullptr_t) {
|
||||
return experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(nullptr_t, const propagate_const<_Tp>& __pt) {
|
||||
return nullptr != experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
|
||||
return experimental::get_underlying(__pt) == experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
|
||||
return experimental::get_underlying(__pt) != experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
|
||||
return experimental::get_underlying(__pt) < experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
|
||||
return experimental::get_underlying(__pt) > experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
|
||||
return experimental::get_underlying(__pt) <= experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const propagate_const<_Tp>& __pt, const propagate_const<_Up>& __pu) {
|
||||
return experimental::get_underlying(__pt) >= experimental::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;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const propagate_const<_Tp>& __pt, const _Up& __u) {
|
||||
return experimental::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;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const propagate_const<_Tp>& __pt, const _Up& __u) {
|
||||
return experimental::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;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const propagate_const<_Tp>& __pt, const _Up& __u) {
|
||||
return experimental::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;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const propagate_const<_Tp>& __pt, const _Up& __u) {
|
||||
return experimental::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;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const propagate_const<_Tp>& __pt, const _Up& __u) {
|
||||
return experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const propagate_const<_Tp>& __pt, const _Up& __u) {
|
||||
return experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator==(const _Tp& __t, const propagate_const<_Up>& __pu) {
|
||||
return __t == experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator!=(const _Tp& __t, const propagate_const<_Up>& __pu) {
|
||||
return __t != experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<(const _Tp& __t, const propagate_const<_Up>& __pu) {
|
||||
return __t < experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>(const _Tp& __t, const propagate_const<_Up>& __pu) {
|
||||
return __t > experimental::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);
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator<=(const _Tp& __t, const propagate_const<_Up>& __pu) {
|
||||
return __t <= experimental::get_underlying(__pu);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Up>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool operator>=(const _Tp& __t, const propagate_const<_Up>& __pu) {
|
||||
return __t >= experimental::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)
|
||||
{
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr void
|
||||
swap(propagate_const<_Tp>& __pc1, propagate_const<_Tp>& __pc2) noexcept(__is_nothrow_swappable_v<_Tp>) {
|
||||
__pc1.swap(__pc2);
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_CONSTEXPR const _Tp& get_underlying(const propagate_const<_Tp>& __pt) _NOEXCEPT
|
||||
{
|
||||
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
|
||||
{
|
||||
constexpr _Tp& get_underlying(propagate_const<_Tp>& __pt) _NOEXCEPT {
|
||||
return __pt.__t_;
|
||||
}
|
||||
|
||||
|
@ -501,92 +402,78 @@ _LIBCPP_END_NAMESPACE_LFTS_V2
|
|||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _Tp>
|
||||
struct hash<experimental::fundamentals_v2::propagate_const<_Tp>>
|
||||
{
|
||||
struct hash<experimental::propagate_const<_Tp>> {
|
||||
typedef size_t result_type;
|
||||
typedef experimental::fundamentals_v2::propagate_const<_Tp> argument_type;
|
||||
typedef experimental::propagate_const<_Tp> argument_type;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI size_t operator()(const experimental::fundamentals_v2::propagate_const<_Tp>& __pc1) const
|
||||
{
|
||||
return std::hash<_Tp>()(_VSTD_LFTS_V2::get_underlying(__pc1));
|
||||
_LIBCPP_HIDE_FROM_ABI size_t operator()(const experimental::propagate_const<_Tp>& __pc1) const {
|
||||
return std::hash<_Tp>()(experimental::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;
|
||||
struct equal_to<experimental::propagate_const<_Tp>> {
|
||||
typedef experimental::propagate_const<_Tp> first_argument_type;
|
||||
typedef experimental::propagate_const<_Tp> second_argument_type;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI 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));
|
||||
_LIBCPP_HIDE_FROM_ABI bool
|
||||
operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
|
||||
return std::equal_to<_Tp>()(experimental::get_underlying(__pc1), experimental::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;
|
||||
struct not_equal_to<experimental::propagate_const<_Tp>> {
|
||||
typedef experimental::propagate_const<_Tp> first_argument_type;
|
||||
typedef experimental::propagate_const<_Tp> second_argument_type;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI 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));
|
||||
_LIBCPP_HIDE_FROM_ABI bool
|
||||
operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
|
||||
return std::not_equal_to<_Tp>()(experimental::get_underlying(__pc1), experimental::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;
|
||||
struct less<experimental::propagate_const<_Tp>> {
|
||||
typedef experimental::propagate_const<_Tp> first_argument_type;
|
||||
typedef experimental::propagate_const<_Tp> second_argument_type;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI 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));
|
||||
_LIBCPP_HIDE_FROM_ABI bool
|
||||
operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
|
||||
return std::less<_Tp>()(experimental::get_underlying(__pc1), experimental::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;
|
||||
struct greater<experimental::propagate_const<_Tp>> {
|
||||
typedef experimental::propagate_const<_Tp> first_argument_type;
|
||||
typedef experimental::propagate_const<_Tp> second_argument_type;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI 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));
|
||||
_LIBCPP_HIDE_FROM_ABI bool
|
||||
operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
|
||||
return std::greater<_Tp>()(experimental::get_underlying(__pc1), experimental::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;
|
||||
struct less_equal<experimental::propagate_const<_Tp>> {
|
||||
typedef experimental::propagate_const<_Tp> first_argument_type;
|
||||
typedef experimental::propagate_const<_Tp> second_argument_type;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI 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));
|
||||
_LIBCPP_HIDE_FROM_ABI bool
|
||||
operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
|
||||
return std::less_equal<_Tp>()(experimental::get_underlying(__pc1), experimental::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;
|
||||
struct greater_equal<experimental::propagate_const<_Tp>> {
|
||||
typedef experimental::propagate_const<_Tp> first_argument_type;
|
||||
typedef experimental::propagate_const<_Tp> second_argument_type;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI 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_HIDE_FROM_ABI bool
|
||||
operator()(const experimental::propagate_const<_Tp>& __pc1, const experimental::propagate_const<_Tp>& __pc2) const {
|
||||
return std::greater_equal<_Tp>()(experimental::get_underlying(__pc1), experimental::get_underlying(__pc2));
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -594,6 +481,8 @@ _LIBCPP_END_NAMESPACE_STD
|
|||
|
||||
#endif // _LIBCPP_STD_VER >= 14
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
|
||||
# include <type_traits>
|
||||
#endif
|
||||
|
|
69
third_party/libcxx/experimental/regex
vendored
69
third_party/libcxx/experimental/regex
vendored
|
@ -1,69 +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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#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
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
template <class _BiDirIter>
|
||||
using match_results =
|
||||
_VSTD::match_results<_BiDirIter,
|
||||
polymorphic_allocator<_VSTD::sub_match<_BiDirIter>>>;
|
||||
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("cmatch") typedef match_results<const char*> cmatch;
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("smatch") typedef match_results<_VSTD_LFTS_PMR::string::const_iterator> smatch;
|
||||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("wcmatch") typedef match_results<const wchar_t*> wcmatch;
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("wsmatch") typedef match_results<_VSTD_LFTS_PMR::wstring::const_iterator> wsmatch;
|
||||
#endif
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_REGEX */
|
62
third_party/libcxx/experimental/set
vendored
62
third_party/libcxx/experimental/set
vendored
|
@ -1,62 +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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#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
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
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>>;
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_SET */
|
1621
third_party/libcxx/experimental/simd
vendored
1621
third_party/libcxx/experimental/simd
vendored
File diff suppressed because it is too large
Load diff
73
third_party/libcxx/experimental/string
vendored
73
third_party/libcxx/experimental/string
vendored
|
@ -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_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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#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
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
|
||||
template <class _CharT, class _Traits = char_traits<_CharT>>
|
||||
using basic_string =
|
||||
_VSTD::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
|
||||
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("string") typedef basic_string<char> string;
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("u16string") typedef basic_string<char16_t> u16string;
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("u32string") typedef basic_string<char32_t> u32string;
|
||||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
||||
_LIBCPP_DEPCREATED_MEMORY_RESOURCE("wstring") typedef basic_string<wchar_t> wstring;
|
||||
#endif
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_STRING */
|
70
third_party/libcxx/experimental/type_traits
vendored
70
third_party/libcxx/experimental/type_traits
vendored
|
@ -68,17 +68,16 @@ inline namespace fundamentals_v1 {
|
|||
|
||||
*/
|
||||
|
||||
#include <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <experimental/__config>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 14
|
||||
|
||||
#include <initializer_list>
|
||||
#include <type_traits>
|
||||
# include <initializer_list>
|
||||
# include <type_traits>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
# endif
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_LFTS
|
||||
|
||||
|
@ -104,49 +103,48 @@ using raw_invocation_type_t = typename raw_invocation_type<_Tp>::type;
|
|||
*/
|
||||
|
||||
// 3.3.4, Detection idiom
|
||||
template <class...> using void_t = void;
|
||||
template <class...>
|
||||
using void_t = void;
|
||||
|
||||
struct nonesuch : private __nat { // make nonesuch "not an aggregate"
|
||||
~nonesuch() = delete;
|
||||
nonesuch (nonesuch const&) = delete;
|
||||
~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;
|
||||
};
|
||||
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...>;
|
||||
};
|
||||
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>
|
||||
constexpr bool is_detected_v = is_detected<_Op, _Args...>::value;
|
||||
|
||||
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 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;
|
||||
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;
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS
|
||||
|
||||
|
|
78
third_party/libcxx/experimental/unordered_map
vendored
78
third_party/libcxx/experimental/unordered_map
vendored
|
@ -1,78 +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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#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
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
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>>>;
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
|
||||
# include <algorithm>
|
||||
# include <array>
|
||||
# include <bit>
|
||||
# include <functional>
|
||||
# include <vector>
|
||||
#endif
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_MAP */
|
64
third_party/libcxx/experimental/unordered_set
vendored
64
third_party/libcxx/experimental/unordered_set
vendored
|
@ -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_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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#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
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
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>>;
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_UNORDERED_SET */
|
3
third_party/libcxx/experimental/utility
vendored
3
third_party/libcxx/experimental/utility
vendored
|
@ -30,7 +30,6 @@ inline namespace fundamentals_v1 {
|
|||
|
||||
*/
|
||||
|
||||
#include <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <experimental/__config>
|
||||
#include <utility>
|
||||
|
||||
|
@ -40,7 +39,7 @@ inline namespace fundamentals_v1 {
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_LFTS
|
||||
|
||||
struct _LIBCPP_TEMPLATE_VIS erased_type { };
|
||||
struct _LIBCPP_TEMPLATE_VIS erased_type {};
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS
|
||||
|
||||
|
|
52
third_party/libcxx/experimental/vector
vendored
52
third_party/libcxx/experimental/vector
vendored
|
@ -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_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 <__assert> // all public C++ headers provide the assertion handler
|
||||
#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
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
template <class _ValueT>
|
||||
using vector = _VSTD::vector<_ValueT, polymorphic_allocator<_ValueT>>;
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS_PMR
|
||||
|
||||
#endif /* _LIBCPP_EXPERIMENTAL_VECTOR */
|
Loading…
Add table
Add a link
Reference in a new issue