#include <initializer_list>
#endif
+#define __glibcxx_want_constexpr_algorithms
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
// adjacent_find
-#if __cplusplus > 201703L
-# define __cpp_lib_constexpr_algorithms 201806L
-#endif
-
#if __cplusplus >= 201103L
template<typename _IIter, typename _Predicate>
_GLIBCXX20_CONSTEXPR
#include <bits/c++config.h>
+#define __glibcxx_want_assume_aligned
+#include <bits/version.h>
+
#include <bit> // std::has_single_bit
#include <stdint.h> // uintptr_t
#include <debug/assertions.h> // _GLIBCXX_DEBUG_ASSERT
}
}
-#if __cplusplus > 201703L
-#define __cpp_lib_assume_aligned 201811L
+#ifdef __cpp_lib_assume_aligned // C++ >= 20
/** @brief Inform the compiler that a pointer is aligned.
*
* @tparam _Align An alignment value (i.e. a power of two)
return static_cast<_Tp*>(__builtin_assume_aligned(__ptr, _Align));
}
}
-#endif // C++2a
+#endif // __cpp_lib_assume_aligned
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
# endif
#endif
+#define __glibcxx_want_constexpr_dynamic_alloc
+#define __glibcxx_want_allocator_traits_is_always_equal
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L
-#define __cpp_lib_allocator_traits_is_always_equal 201411L
-
/// @cond undocumented
struct __allocator_traits_base
{
};
#if _GLIBCXX_HOSTED
-
-#if __cplusplus > 201703L
-# define __cpp_lib_constexpr_dynamic_alloc 201907L
-#endif
-
/// Partial specialization for std::allocator.
template<typename _Tp>
struct allocator_traits<allocator<_Tp>>
#include <type_traits>
#endif
-#define __cpp_lib_incomplete_container_elements 201505L
+#define __glibcxx_want_incomplete_container_elements
+#include <bits/version.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
#endif
+#define __glibcxx_want_atomic_value_initialization
+#define __glibcxx_want_atomic_flag_test
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
return __ret;
}
-#if __cplusplus >= 202002L
-# define __cpp_lib_atomic_value_initialization 201911L
-#endif
-
/// @cond undocumented
#if __cpp_lib_atomic_value_initialization
# define _GLIBCXX20_INIT(I) = I
return __atomic_test_and_set (&_M_i, int(__m));
}
-#if __cplusplus > 201703L
-#define __cpp_lib_atomic_flag_test 201907L
-
+#ifdef __cpp_lib_atomic_flag_test // C++ >= 20
_GLIBCXX_ALWAYS_INLINE bool
test(memory_order __m = memory_order_seq_cst) const noexcept
{
__atomic_load(&_M_i, &__v, int(__m));
return __v == __GCC_ATOMIC_TEST_AND_SET_TRUEVAL;
}
+#endif
-#if __cpp_lib_atomic_wait
+#if __cpp_lib_atomic_wait // C++ >= 20 && (linux_futex || gthread)
_GLIBCXX_ALWAYS_INLINE void
wait(bool __old,
memory_order __m = memory_order_seq_cst) const noexcept
// TODO add const volatile overload
#endif // __cpp_lib_atomic_wait
-#endif // C++20
_GLIBCXX_ALWAYS_INLINE void
clear(memory_order __m = memory_order_seq_cst) noexcept
#pragma GCC system_header
-#include <bits/c++config.h>
-#if defined _GLIBCXX_HAS_GTHREADS || defined _GLIBCXX_HAVE_LINUX_FUTEX
+#define __glibcxx_want_atomic_wait
+#include <bits/version.h>
+
+#if __cpp_lib_atomic_wait
#include <bits/functional_hash.h>
#include <bits/gthr.h>
#include <ext/numeric_traits.h>
# include <bits/std_mutex.h> // std::mutex, std::__condvar
-#define __cpp_lib_atomic_wait 201907L
-
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // GTHREADS || LINUX_FUTEX
+#endif // __cpp_lib_atomic_wait
#endif // _GLIBCXX_ATOMIC_WAIT_H
# include <string_view>
#endif
+#define __glibcxx_want_constexpr_string
+#define __glibcxx_want_string_resize_and_overwrite
+#define __glibcxx_want_string_udls
+#include <bits/version.h>
+
#if ! _GLIBCXX_USE_CXX11_ABI
# include "cow_string.h"
#else
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CXX11
-#ifdef __cpp_lib_is_constant_evaluated
-// Support P0980R1 in C++20.
-# define __cpp_lib_constexpr_string 201907L
-#elif __cplusplus >= 201703L && _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
-// Support P0426R1 changes to char_traits in C++17.
-# define __cpp_lib_constexpr_string 201611L
-#endif
-
/**
* @class basic_string basic_string.h <string>
* @brief Managing sequences of characters and character-like objects.
#pragma GCC diagnostic pop
#endif
-#if __cplusplus > 202002L
-#define __cpp_lib_string_resize_and_overwrite 202110L
+#ifdef __cpp_lib_string_resize_and_overwrite // C++ >= 23
/** Resize the string and call a function to fill it.
*
* @param __n The maximum size requested.
{ };
#endif
-#if __cplusplus >= 201402L
-
-#define __cpp_lib_string_udls 201304L
-
+#ifdef __cpp_lib_string_udls // C++ >= 14
inline namespace literals
{
inline namespace string_literals
#pragma GCC diagnostic pop
} // inline namespace string_literals
} // inline namespace literals
+#endif // __cpp_lib_string_udls
#if __cplusplus >= 201703L
namespace __detail::__variant
{ };
} // namespace __detail::__variant
#endif // C++17
-#endif // C++14
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
# define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
#endif
+#define __glibcxx_want_constexpr_char_traits
+#include <bits/version.h>
+
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#ifdef __cpp_lib_is_constant_evaluated
-// Unofficial macro indicating P1032R1 support in C++20
-# define __cpp_lib_constexpr_char_traits 201811L
-#elif __cplusplus >= 201703L && _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
-// Unofficial macro indicating P0426R1 support in C++17
-# define __cpp_lib_constexpr_char_traits 201611L
-#endif
-
// 21.1
/**
* @brief Basis for explicit traits specializations.
#pragma GCC system_header
+#define __glibcxx_want_chrono
+#define __glibcxx_want_chrono_udls
+#include <bits/version.h>
+
#if __cplusplus >= 201103L
#include <ratio>
{ };
#endif // C++20
-#if __cplusplus >= 201703L
-# define __cpp_lib_chrono 201611L
-
+#ifdef __cpp_lib_chrono // C++ >= 17 && HOSTED
/** Convert a `duration` to type `ToDur` and round down.
*
* If the duration cannot be represented exactly in the result type,
// Make chrono::ceil<D> also usable as chrono::__detail::ceil<D>.
namespace __detail { using chrono::ceil; }
-#else // ! C++17
+#else // ! __cpp_lib_chrono
// We want to use ceil even when compiling for earlier standards versions.
// C++11 only allows a single statement in a constexpr function, so we
return __detail::__ceil_impl(chrono::duration_cast<_ToDur>(__d), __d);
}
}
-#endif // C++17
+#endif // __cpp_lib_chrono
/// duration_values
template<typename _Rep>
#endif // C++20
} // namespace chrono
-#if __cplusplus >= 201402L
-#define __cpp_lib_chrono_udls 201304L
-
+#ifdef __cpp_lib_chrono_udls // C++ >= 14 && HOSTED
inline namespace literals
{
/** ISO C++ 2014 namespace for suffixes for duration literals.
{
using namespace literals::chrono_literals;
} // namespace chrono
-#endif // C++14
+#endif // __cpp_lib_chrono_udls
#if __cplusplus >= 201703L
namespace filesystem
#include <ext/atomicity.h> // _Atomic_word, __is_single_threaded
-#ifdef __cpp_lib_is_constant_evaluated
-// Support P1032R1 in C++20 (but not P0980R1 for COW strings).
-# define __cpp_lib_constexpr_string 201811L
-#elif __cplusplus >= 201703L && _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
-// Support P0426R1 changes to char_traits in C++17.
-# define __cpp_lib_constexpr_string 201611L
-#endif
+#define __glibcxx_want_constexpr_string
+#include <bits/version.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
#pragma GCC system_header
-#if __cplusplus >= 201402L
-
#include <bits/c++config.h>
+#define __glibcxx_want_erase_if
+#include <bits/version.h>
+
+#if __cplusplus >= 201402L
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#if __cplusplus > 201703L
-# define __cpp_lib_erase_if 202002L
-#endif
-
namespace __detail
{
template<typename _Container, typename _UnsafeContainer,
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-
#endif // C++14
#endif // _GLIBCXX_ERASE_IF_H
#include <ext/alloc_traits.h>
#include <ext/aligned_buffer.h>
+#define __glibcxx_want_list_remove_return_type
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
/// @}
private:
-#if __cplusplus > 201703L
-# define __cpp_lib_list_remove_return_type 201806L
+#ifdef __cpp_lib_list_remove_return_type // C++20 && HOSTED
using __remove_return_type = size_type;
# define _GLIBCXX_FWDLIST_REMOVE_RETURN_TYPE_TAG \
__attribute__((__abi_tag__("__cxx20")))
# include <bits/node_handle.h>
#endif
+#define __glibcxx_want_generic_unordered_lookup
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
std::pair<const_iterator, const_iterator>
equal_range(const key_type& __k) const;
-#if __cplusplus >= 202002L
-#define __cpp_lib_generic_unordered_lookup 201811L
-
+#ifdef __cpp_lib_generic_unordered_lookup // C++ >= 20 && HOSTED
template<typename _Kt,
typename = __has_is_transparent_t<_Hash, _Kt>,
typename = __has_is_transparent_t<_Equal, _Kt>>
typename = __has_is_transparent_t<_Equal, _Kt>>
pair<const_iterator, const_iterator>
_M_equal_range_tr(const _Kt& __k) const;
-#endif // C++20
+#endif // __cpp_lib_generic_unordered_lookup
private:
// Bucket index computation helpers.
# include <system_error>
#endif
+#define __glibcxx_want_ios_noreplace
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
static const openmode __noreplace = _S_noreplace;
-#if __cplusplus >= 202100L
-#define __cpp_lib_ios_noreplace 202207L
+#ifdef __cpp_lib_ios_noreplace // C++ >= 23 && HOSTED
/// Open a file in exclusive mode.
static const openmode noreplace = _S_noreplace;
#endif
# include <type_traits> // Brings in std::declval too.
#endif
+#define __glibcxx_want_addressof_constexpr
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
// declval, from type_traits.
-#if __cplusplus > 201402L
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 2296. std::addressof should be constexpr
-# define __cpp_lib_addressof_constexpr 201603L
-#endif
/**
* @brief Returns the actual address of the object or function
* referenced by r, even in the presence of an overloaded
#pragma GCC system_header
-#if __cplusplus > 202002L
+#define __glibcxx_want_move_only_function
+#include <bits/version.h>
+
+#ifdef __cpp_lib_move_only_function // C++ >= 23 && HOSTED
#include <bits/invoke.h>
#include <bits/utility.h>
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_move_only_function 202110L
-
template<typename... _Signature>
class move_only_function; // not defined
#define _GLIBCXX_MOF_REF &&
#include "mofunc_impl.h"
-#endif // C++23
+#endif // __cpp_lib_move_only_function
#endif // _GLIBCXX_MOVE_ONLY_FUNCTION_H
#pragma GCC system_header
-#if __cplusplus >= 201703L
-# define __cpp_lib_node_extract 201606L
+#define __glibcxx_want_node_extract
+#include <bits/version.h>
+
+#ifdef __cpp_lib_node_extract // C++ >= 17 && HOSTED
#include <new>
#include <bits/alloc_traits.h>
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++17
+#endif // __cpp_lib_node_extract
#endif
#include <bits/move.h>
-/* Duplicate definition with unique_ptr.h. */
-#if __cplusplus > 202002L && defined(__cpp_constexpr_dynamic_alloc)
-# define __cpp_lib_constexpr_memory 202202L
-#elif __cplusplus > 201703L
-# define __cpp_lib_constexpr_memory 201811L
-#endif
+#define __glibcxx_want_constexpr_memory
+#define __glibcxx_want_to_address
+#include <bits/version.h>
#if __cplusplus > 201703L
#include <concepts>
return __ptr;
}
-#if __cplusplus <= 201703L
+#ifndef __cpp_lib_to_address // C++ < 20
template<typename _Ptr>
constexpr typename std::pointer_traits<_Ptr>::element_type*
__to_address(const _Ptr& __ptr)
return std::__to_address(__ptr.operator->());
}
-#define __cpp_lib_to_address 201711L
-
/**
* @brief Obtain address referenced by a pointer to an object
* @param __ptr A pointer to an object
constexpr auto
to_address(const _Ptr& __ptr) noexcept
{ return std::__to_address(__ptr); }
-#endif // C++2a
+#endif // __cpp_lib_to_address
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#pragma GCC system_header
+#define __glibcxx_want_nonmember_container_access
+#define __glibcxx_want_ssize
+#include <bits/version.h>
+
#if __cplusplus >= 201103L
#include <initializer_list>
#include <type_traits> // common_type_t, make_signed_t
#endif // C++14
-#if __cplusplus >= 201703L
-#define __cpp_lib_nonmember_container_access 201411L
-
+#ifdef __cpp_lib_nonmember_container_access // C++ >= 17
/**
* @brief Return the size of a container.
* @param __cont Container.
constexpr const _Tp*
data(initializer_list<_Tp> __il) noexcept
{ return __il.begin(); }
+#endif // __cpp_lib_nonmember_container_access
-#if __cplusplus > 201703L
-#define __cpp_lib_ssize 201902L
+#ifdef __cpp_lib_ssize // C++ >= 20
template<typename _Container>
[[nodiscard, __gnu__::__always_inline__]]
constexpr auto
constexpr ptrdiff_t
ssize(const _Tp (&)[_Num]) noexcept
{ return _Num; }
-#endif // C++20
-
-#endif // C++17
+#endif // __cpp_lib_ssize
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#include <bits/ranges_util.h>
#include <bits/uniform_int_dist.h> // concept uniform_random_bit_generator
+#define __glibcxx_want_ranges_contains
+#define __glibcxx_want_ranges_find_last
+#define __glibcxx_want_ranges_fold
+#define __glibcxx_want_ranges_iota
+#define __glibcxx_want_shift
+#include <bits/version.h>
+
#if __cpp_lib_concepts
namespace std _GLIBCXX_VISIBILITY(default)
{
inline constexpr __prev_permutation_fn prev_permutation{};
-#if __cplusplus > 202002L
-
-#define __cpp_lib_ranges_contains 202207L
-
+#if __cpp_lib_ranges_contains >= 202207L // C++ >= 23
struct __contains_fn
{
template<input_iterator _Iter, sentinel_for<_Iter> _Sent,
inline constexpr __contains_subrange_fn contains_subrange{};
-#define __cpp_lib_ranges_iota 202202L
+#endif // __cpp_lib_ranges_contains
+
+#if __cpp_lib_ranges_iota >= 202202L // C++ >= 23
template<typename _Out, typename _Tp>
struct out_value_result
inline constexpr __iota_fn iota{};
-#define __cpp_lib_ranges_find_last 202207L
+#endif // __cpp_lib_ranges_iota
+
+#if __cpp_lib_ranges_find_last >= 202207L // C++ >= 23
struct __find_last_fn
{
inline constexpr __find_last_if_not_fn find_last_if_not{};
-#define __cpp_lib_ranges_fold 202207L
+#endif // __cpp_lib_ranges_find_last
+
+#if __cpp_lib_ranges_fold >= 202207L // C++ >= 23
template<typename _Iter, typename _Tp>
struct in_value_result
};
inline constexpr __fold_right_last_fn fold_right_last{};
-#endif // C++23
+#endif // __cpp_lib_ranges_fold
} // namespace ranges
-#define __cpp_lib_shift 201806L
template<typename _ForwardIterator>
constexpr _ForwardIterator
shift_left(_ForwardIterator __first, _ForwardIterator __last,
#ifndef _RANGES_CMP_H
#define _RANGES_CMP_H 1
+#define __glibcxx_want_ranges
+#include <bits/version.h>
+
#if __cplusplus > 201703L
# include <bits/move.h>
# include <concepts>
using is_transparent = __is_transparent;
};
-#ifdef __cpp_lib_concepts
-// Define this here, included by all the headers that need to define it.
-#if __cplusplus > 202002L
-#define __cpp_lib_ranges 202202L
-#else
-#define __cpp_lib_ranges 202110L
-#endif
-
+#ifdef __cpp_lib_ranges // C++ >= 20
namespace ranges
{
namespace __detail
};
} // namespace ranges
-#endif // library concepts
+#endif // __cpp_lib_ranges
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++20
#include <iosfwd> // std::basic_ostream
#include <bits/shared_ptr_base.h>
+#define __glibcxx_want_shared_ptr_weak_type
+#define __glibcxx_want_enable_shared_from_this
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
/// The type pointed to by the stored pointer, remove_extent_t<_Tp>
using element_type = typename __shared_ptr<_Tp>::element_type;
-#if __cplusplus >= 201703L
-# define __cpp_lib_shared_ptr_weak_type 201606L
+#ifdef __cpp_lib_shared_ptr_weak_type // C++ >= 17 && HOSTED
/// The corresponding weak_ptr type for this shared_ptr
/// @since C++17
using weak_type = weak_ptr<_Tp>;
shared_from_this() const
{ return shared_ptr<const _Tp>(this->_M_weak_this); }
-#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
-#define __cpp_lib_enable_shared_from_this 201603L
+#ifdef __cpp_lib_enable_shared_from_this // C++ >= 17 && HOSTED
/** @{
* Get a `weak_ptr` referring to the object that has `*this` as its base.
* @since C++17
#include <bits/atomic_base.h>
+#define __glibcxx_want_atomic_shared_ptr
+#include <bits/version.h>
+
// Annotations for the custom locking in atomic<shared_ptr<T>>.
#if defined _GLIBCXX_TSAN && __has_include(<sanitizer/tsan_interface.h>)
#include <sanitizer/tsan_interface.h>
/// @} group pointer_abstractions
-#if __cplusplus >= 202002L
-# define __cpp_lib_atomic_shared_ptr 201711L
+#ifdef __cpp_lib_atomic_shared_ptr // C++ >= 20 && HOSTED
template<typename _Tp>
struct atomic;
# include <bits/stl_uninitialized.h>
#endif
+#define __glibcxx_want_smart_ptr_for_overwrite
+#define __glibcxx_want_shared_ptr_arrays
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
_Impl _M_impl;
};
-#if __cplusplus >= 202002L
-# define __cpp_lib_smart_ptr_for_overwrite 202002L
+#ifdef __cpp_lib_smart_ptr_for_overwrite // C++ >= 20 && HOSTED
struct _Sp_overwrite_tag { };
// Partial specialization used for make_shared_for_overwrite<non-array>().
_M_get_deleter(const std::type_info&) noexcept override
{ return nullptr; }
};
-#endif // C++20
-
-#if __cplusplus <= 201703L
-# define __cpp_lib_shared_ptr_arrays 201611L
-#else
-# define __cpp_lib_shared_ptr_arrays 201707L
+#endif // __cpp_lib_smart_ptr_for_overwrite
+#if __cpp_lib_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
struct _Sp_overwrite_tag;
// For make_shared<T[]>, make_shared<T[N]>, allocate_shared<T[]> etc.
_M_get_deleter(const std::type_info&) noexcept override
{ return nullptr; }
};
-#endif // C++20
+#endif // __cpp_lib_shared_ptr_arrays >= 201707L
// The default deleter for shared_ptr<T[]> and shared_ptr<T[N]>.
struct __sp_array_delete
template<typename _Tp>
struct __not_alloc_shared_tag<_Sp_alloc_shared_tag<_Tp>> { };
-#if __cpp_lib_shared_ptr_arrays >= 201707L
+#if __cpp_lib_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
template<typename _Alloc>
struct __not_alloc_shared_tag<_Sp_counted_array_base<_Alloc>> { };
#endif
__p = __pi->_M_ptr();
}
-#if __cpp_lib_shared_ptr_arrays >= 201707L
+#if __cpp_lib_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
template<typename _Tp, typename _Alloc, typename _Init>
__shared_count(_Tp*& __p, const _Sp_counted_array_base<_Alloc>& __a,
_Init __init)
friend __shared_ptr<_Tp1, _Lp1>
__allocate_shared(const _Alloc& __a, _Args&&... __args);
-#if __cpp_lib_shared_ptr_arrays >= 201707L
+#if __cpp_lib_shared_ptr_arrays >= 201707L // C++ >= 20 && HOSTED
// This constructor is non-standard, it is used by allocate_shared<T[]>.
template<typename _Alloc, typename _Init = const remove_extent_t<_Tp>*>
__shared_ptr(const _Sp_counted_array_base<_Alloc>& __a,
#include <bits/c++config.h>
-#define __STDCPP_MATH_SPEC_FUNCS__ 201003L
-
-#define __cpp_lib_math_special_functions 201603L
+#define __glibcxx_want_math_spec_funcs
+#define __glibcxx_want_math_special_functions
+#include <bits/version.h>
#if __cplusplus <= 201403L && __STDCPP_WANT_MATH_SPEC_FUNCS__ == 0
# error include <cmath> and define __STDCPP_WANT_MATH_SPEC_FUNCS__
# endif
#endif
+#define __glibcxx_want_clamp
+#define __glibcxx_want_sample
+#include <bits/version.h>
+
// See concept_check.h for the __glibcxx_*_requires macros.
namespace std _GLIBCXX_VISIBILITY(default)
return std::__is_permutation(__first1, __last1, __first2, __last2,
__gnu_cxx::__ops::__iter_comp_iter(__pred));
}
+#endif // C++14
-#if __cplusplus >= 201703L
-
-#define __cpp_lib_clamp 201603L
-
+#ifdef __cpp_lib_clamp // C++ >= 17
/**
* @brief Returns the value clamped between lo and hi.
* @ingroup sorting_algorithms
__glibcxx_assert(!__comp(__hi, __lo));
return std::min(std::max(__val, __lo, __comp), __hi, __comp);
}
-#endif // C++17
-#endif // C++14
+#endif // __cpp_lib_clamp
/**
* @brief Generate two uniformly distributed integers using a
}
return __out;
}
+#endif // C++14
-#if __cplusplus > 201402L
-#define __cpp_lib_sample 201603L
+#ifdef __cpp_lib_sample // C++ >= 17
/// Take a random sample from a population.
template<typename _PopulationIterator, typename _SampleIterator,
typename _Distance, typename _UniformRandomBitGenerator>
__sample(__first, __last, __pop_cat{}, __out, __samp_cat{}, __d,
std::forward<_UniformRandomBitGenerator>(__g));
}
-#endif // C++17
-#endif // C++14
+#endif // __cpp_lib_sample
_GLIBCXX_END_NAMESPACE_ALGO
_GLIBCXX_END_NAMESPACE_VERSION
# include <compare>
#endif
+#define __glibcxx_want_robust_nonmodifying_seq_ops
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
}
#endif // C++11
-#if __cplusplus > 201103L
-
-#define __cpp_lib_robust_nonmodifying_seq_ops 201304L
-
+#ifdef __cpp_lib_robust_nonmodifying_seq_ops // C++ >= 14
/**
* @brief Tests a range for element-wise equality.
* @ingroup non_mutating_algorithms
return _GLIBCXX_STD_A::__equal4(__first1, __last1, __first2, __last2,
__binary_pred);
}
-#endif // C++14
+#endif // __cpp_lib_robust_nonmodifying_seq_ops
/**
* @brief Performs @b dictionary comparison on ranges.
__gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
}
-#if __cplusplus > 201103L
-
+#if __cpp_lib_robust_nonmodifying_seq_ops // C++ >= 14
template<typename _InputIterator1, typename _InputIterator2,
typename _BinaryPredicate>
_GLIBCXX20_CONSTEXPR
#include <bits/move.h>
#endif
+#define __glibcxx_want_transparent_operators
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
* @{
*/
-#if __cplusplus > 201103L
+#if __cpp_lib_transparent_operators // C++ >= 14
struct __is_transparent; // undefined
template<typename _Tp = void>
};
#pragma GCC diagnostic pop
-#if __cplusplus > 201103L
-
-#define __cpp_lib_transparent_operators 201510L
-
+#ifdef __cpp_lib_transparent_operators // C++ >= 14
template<>
struct plus<void>
{
*
* @{
*/
-#if __cplusplus > 201103L
+#if __cpp_lib_transparent_operators // C++ >= 14
template<typename _Tp = void>
struct equal_to;
};
#pragma GCC diagnostic pop
-#if __cplusplus >= 201402L
+#ifdef __cpp_lib_transparent_operators // C++ >= 14
/// One of the @link comparison_functors comparison functors@endlink.
template<>
struct equal_to<void>
is_convertible<_Tp, const volatile void*>,
is_convertible<_Up, const volatile void*>>;
};
-#endif // C++14
+#endif // __cpp_lib_transparent_operators
/** @} */
// 20.3.4 logical operations
*
* @{
*/
-#if __cplusplus > 201103L
+#ifdef __cpp_lib_transparent_operators // C++ >= 14
template<typename _Tp = void>
struct logical_and;
};
#pragma GCC diagnostic pop
-#if __cplusplus > 201103L
+#ifdef __cpp_lib_transparent_operators // C++ >= 14
/// One of the @link logical_functors Boolean operations functors@endlink.
template<>
struct logical_and<void>
typedef __is_transparent is_transparent;
};
-#endif
+#endif // __cpp_lib_transparent_operators
/** @} */
-#if __cplusplus > 201103L
+#ifdef __cpp_lib_transparent_operators // C++ >= 14
template<typename _Tp = void>
struct bit_and;
};
#pragma GCC diagnostic pop
-#if __cplusplus > 201103L
+#ifdef __cpp_lib_transparent_operators // C++ >= 14
template <>
struct bit_and<void>
{
/** @} */
-#if __cplusplus >= 201402L
+#ifdef __cpp_lib_transparent_operators // C++ >= 14
template<typename _Func, typename _SfinaeType, typename = __void_t<>>
struct __has_is_transparent
{ };
# include <type_traits>
#endif
-#if __cplusplus > 201703L
-# define __cpp_lib_array_constexpr 201811L
-# define __cpp_lib_constexpr_iterator 201811L
-#elif __cplusplus == 201703L
-# define __cpp_lib_array_constexpr 201803L
-#endif
+#define __glibcxx_want_constexpr_iterator
+#define __glibcxx_want_array_constexpr
+#define __glibcxx_want_make_reverse_iterator
+#define __glibcxx_want_move_iterator_concept
+#include <bits/version.h>
#if __cplusplus >= 202002L
# include <compare>
__make_reverse_iterator(_Iterator __i)
{ return reverse_iterator<_Iterator>(__i); }
-# if __cplusplus >= 201402L
-# define __cpp_lib_make_reverse_iterator 201402L
-
+# ifdef __cpp_lib_make_reverse_iterator // C++ >= 14
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR 2285. make_reverse_iterator
/// Generator function for reverse_iterator.
disable_sized_sentinel_for<reverse_iterator<_Iterator1>,
reverse_iterator<_Iterator2>> = true;
# endif // C++20
-# endif // C++14
+# endif // __cpp_lib_make_reverse_iterator
template<typename _Iterator>
_GLIBCXX20_CONSTEXPR
template<typename _Iter2>
friend class move_iterator;
-#if __cpp_lib_concepts
+#if __cpp_lib_concepts // C++20 && concepts
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 3435. three_way_comparable_with<reverse_iterator<int*>, [...]>
template<typename _Iter2>
public:
using iterator_type = _Iterator;
-#if __cplusplus > 201703L && __cpp_lib_concepts
- // This is P2520R0, a C++23 change, but we treat it as a DR against C++20.
-# define __cpp_lib_move_iterator_concept 202207L
+#ifdef __cpp_lib_move_iterator_concept // C++ >= 20 && lib_concepts
using iterator_concept = decltype(_S_iter_concept());
// iterator_category defined in __move_iter_cat
#include <ext/aligned_buffer.h>
#endif
+#define __glibcxx_want_list_remove_return_type
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
private:
-#if __cplusplus > 201703L
-# define __cpp_lib_list_remove_return_type 201806L
+#ifdef __cpp_lib_list_remove_return_type // C++ >= 20 && HOSTED
typedef size_type __remove_return_type;
# define _GLIBCXX_LIST_REMOVE_RETURN_TYPE_TAG \
__attribute__((__abi_tag__("__cxx20")))
#include <tuple>
#endif
+#define __glibcxx_want_map_try_emplace
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
{ merge(__source); }
#endif // C++17
-#if __cplusplus > 201402L
-#define __cpp_lib_map_try_emplace 201411L
+#ifdef __cpp_lib_map_try_emplace // C++ >= 17 && HOSTED
/**
* @brief Attempts to build and insert a std::pair into the %map.
*
#endif
#if __cplusplus >= 202002L
# include <compare>
-# define __cpp_lib_constexpr_utility 201811L
#endif
+#define __glibcxx_want_constexpr_utility
+#define __glibcxx_want_tuples_by_type
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
get(const pair<_Tp1, _Tp2>&& __in) noexcept
{ return __pair_get<_Int>::__const_move_get(std::move(__in)); }
-#if __cplusplus >= 201402L
-
-#define __cpp_lib_tuples_by_type 201304L
+#ifdef __cpp_lib_tuples_by_type // C++ >= 14
template <typename _Tp, typename _Up>
constexpr _Tp&
get(pair<_Tp, _Up>& __p) noexcept
constexpr const _Tp&&
get(const pair<_Up, _Tp>&& __p) noexcept
{ return std::move(__p.second); }
+#endif // __cpp_lib_tuples_by_type
+
#if __cplusplus > 202002L
template<typename _T1, typename _T2, typename _U1, typename _U2,
{ using type = pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>; };
#endif // C++23
-#endif // C++14
/// @}
#endif // C++11
# include <bits/uses_allocator.h>
#endif
+#define __glibcxx_want_adaptor_iterator_pair_constructor
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Alloc, typename _Requires = _Uses<_Alloc>>
queue(queue&& __q, const _Alloc& __a)
: c(std::move(__q.c), __a) { }
+#endif
-#if __cplusplus > 202002L
-#define __cpp_lib_adaptor_iterator_pair_constructor 202106L
-
+#ifdef __cpp_lib_adaptor_iterator_pair_constructor // C++ >= 23 && HOSTED
template<typename _InputIterator,
typename = _RequireInputIter<_InputIterator>>
queue(_InputIterator __first, _InputIterator __last)
typename = _Uses<_Alloc>>
queue(_InputIterator __first, _InputIterator __last, const _Alloc& __a)
: c(__first, __last, __a) { }
-#endif
#endif
/**
# include <bits/uses_allocator.h>
#endif
+#define __glibcxx_want_adaptor_iterator_pair_constructor
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
stack(_Sequence&& __c)
: c(std::move(__c)) { }
-#if __cplusplus > 202002L
-#define __cpp_lib_adaptor_iterator_pair_constructor 202106L
-
+#ifdef __cpp_lib_adaptor_iterator_pair_constructor // C++ >= 23 && HOSTED
template<typename _InputIterator,
typename = _RequireInputIter<_InputIterator>>
stack(_InputIterator __first, _InputIterator __last)
# include <bits/node_handle.h>
#endif
+#define __glibcxx_want_generic_associative_lookup
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#if __cplusplus > 201103L
-# define __cpp_lib_generic_associative_lookup 201304L
-#endif
-
// Red-black tree class, designed for use in implementing STL
// associative containers (set, multiset, map, and multimap). The
// insertion and deletion algorithms are based on those in Cormen,
#include <bits/stl_pair.h>
#endif
+#define __glibcxx_want_raw_memory_algorithms
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
/// @endcond
#endif
-#if __cplusplus >= 201703L
-# define __cpp_lib_raw_memory_algorithms 201606L
-
+#ifdef __cpp_lib_raw_memory_algorithms // C++ >= 17
/**
* @brief Default-initializes objects in the range [first,last).
* @param __first A forward iterator.
__count, __result);
return {__res.first.base(), __res.second};
}
-#endif // C++17
+#endif // __cpp_lib_raw_memory_algorithms
#if __cplusplus >= 201103L
/// @cond undocumented
#endif
#if __cplusplus >= 202002L
# include <compare>
-#define __cpp_lib_constexpr_vector 201907L
#endif
+#define __glibcxx_want_constexpr_vector
+#include <bits/version.h>
+
#include <debug/assertions.h>
#if _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
+
// unique_ptr implementation -*- C++ -*-
// Copyright (C) 2008-2023 Free Software Foundation, Inc.
# endif
#endif
-/* Duplicate definition with ptr_traits.h. */
-#if __cplusplus > 202002L && defined(__cpp_constexpr_dynamic_alloc)
-# define __cpp_lib_constexpr_memory 202202L
-#elif __cplusplus > 201703L
-# define __cpp_lib_constexpr_memory 201811L
-#endif
+#define __glibcxx_want_constexpr_memory
+#define __glibcxx_want_make_unique
+#include <bits/version.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
public __uniq_ptr_hash<unique_ptr<_Tp, _Dp>>
{ };
-#if __cplusplus >= 201402L && _GLIBCXX_HOSTED
-#define __cpp_lib_make_unique 201304L
-
+#ifdef __cpp_lib_make_unique // C++ >= 14 && HOSTED
/// @cond undocumented
namespace __detail
{
#include <bits/functional_hash.h> // hash
#include <bits/stl_function.h> // equal_to
+#define __glibcxx_want_unordered_map_try_emplace
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
iterator
insert(const_iterator, node_type&& __nh)
{ return _M_h._M_reinsert_node(std::move(__nh)).position; }
+#endif // C++17
-#define __cpp_lib_unordered_map_try_emplace 201411L
+#ifdef __cpp_lib_unordered_map_try_emplace // C++ >= 17 && HOSTED
/**
* @brief Attempts to build and insert a std::pair into the
* %unordered_map.
return _M_h.try_emplace(__hint, std::move(__k),
std::forward<_Args>(__args)...).first;
}
-#endif // C++17
+#endif // __cpp_lib_unordered_map_try_emplace
///@{
/**
#pragma GCC system_header
-#if __cplusplus > 201703L && __cpp_concepts
+#define __glibcxx_want_make_obj_using_allocator
+#include <bits/version.h>
+#ifdef __cpp_lib_make_obj_using_allocator // C++ >= 20 && concepts
#include <new> // for placement operator new
#include <tuple> // for tuple, make_tuple, make_from_tuple
#include <bits/stl_construct.h> // construct_at
/** @addtogroup allocators
* @{
*/
-
-// Not specified by C++20, used internally
-#define __cpp_lib_make_obj_using_allocator 201811L
-
template<typename _Tp, typename _Alloc, typename... _Args>
constexpr auto
uses_allocator_construction_args(const _Alloc& __a,
/// @}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++20
+#endif // __cpp_lib_make_obj_using_allocator
#endif // _USES_ALLOCATOR_ARGS
#pragma GCC system_header
+#define __glibcxx_want_tuple_element_t
+#define __glibcxx_want_integer_sequence
+#define __glibcxx_want_ranges_zip
+#include <bits/version.h>
+
#if __cplusplus >= 201103L
#include <type_traits>
}
return __n;
}
+#endif // C++14
// The standard says this macro and alias template should be in <tuple> but we
// define them here, to be available in <array>, <utility> and <ranges> too.
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 3378. tuple_size_v/tuple_element_t should be available when
// tuple_size/tuple_element are
-#define __cpp_lib_tuple_element_t 201402L
-
+#ifdef __cpp_lib_tuple_element_t // C++ >= 14
template<size_t __i, typename _Tp>
using tuple_element_t = typename tuple_element<__i, _Tp>::type;
-#endif // C++14
+#endif
// Stores a tuple of indices. Used by tuple and pair, and by bind() to
// extract the elements in a tuple.
#endif
};
-#if __cplusplus >= 201402L
-
-#define __cpp_lib_integer_sequence 201304L
+#ifdef __cpp_lib_integer_sequence // C++ >= 14
/// Class template integer_sequence
template<typename _Tp, _Tp... _Idx>
/// Alias template index_sequence_for
template<typename... _Types>
using index_sequence_for = make_index_sequence<sizeof...(_Types)>;
+#endif // __cpp_lib_integer_sequence
#if __cplusplus >= 201703L
using __is_in_place_type = bool_constant<__is_in_place_type_v<_Tp>>;
#endif // C++17
-#endif // C++14
#if __has_builtin(__type_pack_element)
template<size_t _Np, typename... _Types>
#endif
#endif
-#if __cplusplus > 202002L
-#define __cpp_lib_ranges_zip 202110L // for <tuple> and <utility>
-#endif
-
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#ifndef _GLIBCXX_STDATOMIC_H
#define _GLIBCXX_STDATOMIC_H
-#if __cplusplus > 202002L
-#include <atomic>
+#define __glibcxx_want_stdatomic_h
+#include <bits/version.h>
-#define __cpp_lib_stdatomic_h 202011L
+#ifdef __cpp_lib_stdatomic_h // C++ >= 23
+#include <atomic>
#define _Atomic(_Tp) std::atomic<_Tp>
#elif defined __clang__
# include_next <stdatomic.h>
-#endif // C++23
+#endif // __cpp_lib_stdatomic_h
#endif // _GLIBCXX_STDATOMIC_H
#ifndef _GLIBCXX_CMATH
#define _GLIBCXX_CMATH 1
+#define __glibcxx_want_hypot
+#define __glibcxx_want_interpolate
+#include <bits/version.h>
+
// Get rid of those macros defined in <math.h> in lieu of real functions.
#undef div
#undef acos
#endif // _GLIBCXX_USE_C99_MATH_FUNCS
#endif // C++11
-#if __cplusplus >= 201703L
-
+#ifdef __cpp_lib_hypot // C++ >= 17 && HOSTED
// [c.math.hypot3], three-dimensional hypotenuse
-#define __cpp_lib_hypot 201603L
-
template<typename _Tp>
inline _Tp
__hypot3(_Tp __x, _Tp __y, _Tp __z)
{ return std::__hypot3<__gnu_cxx::__bfloat16_t>(__x, __y, __z); }
#endif
-#endif // C++17
+#endif // __cpp_lib_hypot
-#if __cplusplus >= 202002L
+#ifdef __cpp_lib_interpolate // C++ >= 20
// linear interpolation
-# define __cpp_lib_interpolate 201902L
-
template<typename _Fp>
constexpr _Fp
__lerp(_Fp __a, _Fp __b, _Fp __t) noexcept
lerp(__gnu_cxx::__bfloat16_t __x, __gnu_cxx::__bfloat16_t __y, __gnu_cxx::__bfloat16_t __z) noexcept
{ return std::__lerp<__gnu_cxx::__bfloat16_t>(__x, __y, __z); }
#endif
-
-#endif // C++20
+#endif // __cpp_lib_interpolate
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#include <bits/c++config.h>
#include <stddef.h>
+#define __glibcxx_want_byte
+#include <bits/version.h>
+
extern "C++"
{
#if __cplusplus >= 201103L
}
#endif // C++11
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_byte // C++ >= 17
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_byte 201603L
-
/// std::byte
enum class byte : unsigned char {};
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++17
+#endif // __cpp_lib_byte
} // extern "C++"
#endif // _GLIBCXX_CSTDDEF
# include <bits/ranges_algo.h>
#endif
-#if __cplusplus > 201402L && _GLIBCXX_HOSTED
+#define __glibcxx_want_parallel_algorithm
+#include <bits/version.h>
+
+#if __cpp_lib_parallel_algorithm // C++ >= 17 && HOSTED
// Parallel STL algorithms
# if _PSTL_EXECUTION_POLICIES_DEFINED
// If <execution> has already been included, pull in implementations
# include <pstl/glue_algorithm_defs.h>
# define _PSTL_ALGORITHM_FORWARD_DECLARED 1
# endif
-
-// Feature test macro for parallel algorithms
-# define __cpp_lib_parallel_algorithm 201603L
-#endif // C++17 && HOSTED
+#endif
#ifdef _GLIBCXX_PARALLEL
# include <parallel/algorithm>
#pragma GCC system_header
-#if __cplusplus >= 201703L
+#define __glibcxx_want_any
+#include <bits/version.h>
+
+#ifdef __cpp_lib_any // C++ >= 17
#include <initializer_list>
#include <typeinfo>
#endif
}
-#define __cpp_lib_any 201606L
-
/**
* @brief A type-safe container of any type.
*
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++17
+#endif // __cpp_lib_any
#endif // _GLIBCXX_ANY
#include <bits/utility.h> // std::index_sequence, std::tuple_size
#include <debug/assertions.h>
+#define __glibcxx_want_to_array
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
{ return std::equal(__one.begin(), __one.end(), __two.begin()); }
-#if __cpp_lib_three_way_comparison && __cpp_lib_concepts
+#if __cpp_lib_three_way_comparison // C++ >= 20 && lib_concepts
template<typename _Tp, size_t _Nm>
[[nodiscard]]
constexpr __detail::__synth3way_t<_Tp>
return std::move(std::get<_Int>(__arr));
}
-#if __cplusplus >= 202002L && __cpp_generic_lambdas >= 201707L
-#define __cpp_lib_to_array 201907L
+#ifdef __cpp_lib_to_array // C++ >= 20 && __cpp_generic_lambdas >= 201707L
template<typename _Tp, size_t _Nm>
[[nodiscard]]
constexpr array<remove_cv_t<_Tp>, _Nm>
else
__builtin_unreachable(); // FIXME: see PR c++/91388
}
-#endif // C++20
+#endif // __cpp_lib_to_array
// Tuple interface to class template array.
# include <bits/c++0x_warning.h>
#else
+#define __glibcxx_want_atomic_is_always_lock_free
+#define __glibcxx_want_atomic_float
+#define __glibcxx_want_atomic_ref
+#define __glibcxx_want_atomic_lock_free_type_aliases
+#include <bits/version.h>
+
#include <bits/atomic_base.h>
namespace std _GLIBCXX_VISIBILITY(default)
* @{
*/
-#if __cplusplus >= 201703L
-# define __cpp_lib_atomic_is_always_lock_free 201603L
-#endif
-
template<typename _Tp>
struct atomic;
bool
is_lock_free() const volatile noexcept { return _M_base.is_lock_free(); }
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_BOOL_LOCK_FREE == 2;
#endif
reinterpret_cast<void *>(-_S_alignment));
}
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free
= __atomic_always_lock_free(sizeof(_M_i), 0);
#endif
is_lock_free() const volatile noexcept
{ return _M_b.is_lock_free(); }
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free
= ATOMIC_POINTER_LOCK_FREE == 2;
#endif
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_CHAR_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_SHORT_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_SHORT_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_INT_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_INT_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_LONG_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_LONG_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_LLONG_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_LLONG_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free = ATOMIC_WCHAR_T_LOCK_FREE == 2;
#endif
};
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus > 201402L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free
= ATOMIC_CHAR8_T_LOCK_FREE == 2;
#endif
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free
= ATOMIC_CHAR16_T_LOCK_FREE == 2;
#endif
using __base_type::operator __integral_type;
using __base_type::operator=;
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_atomic_is_always_lock_free // C++ >= 17
static constexpr bool is_always_lock_free
= ATOMIC_CHAR32_T_LOCK_FREE == 2;
#endif
__atomic_val_t<_ITp> __i) noexcept
{ return atomic_fetch_xor_explicit(__a, __i, memory_order_seq_cst); }
-#if __cplusplus > 201703L
-#define __cpp_lib_atomic_float 201711L
+#ifdef __cpp_lib_atomic_float
template<>
struct atomic<float> : __atomic_float<float>
{
using __atomic_float<__gnu_cxx::__bfloat16_t>::operator=;
};
#endif
+#endif // __cpp_lib_atomic_float
-#define __cpp_lib_atomic_ref 201806L
-
+#ifdef __cpp_lib_atomic_ref
/// Class template to provide atomic operations on a non-atomic variable.
template<typename _Tp>
struct atomic_ref : __atomic_ref<_Tp>
using __atomic_ref<_Tp>::operator=;
};
+#endif // __cpp_lib_atomic_ref
-#define __cpp_lib_atomic_lock_free_type_aliases 201907L
-#ifdef _GLIBCXX_HAVE_PLATFORM_WAIT
+#ifdef __cpp_lib_atomic_lock_free_type_aliases
+# ifdef _GLIBCXX_HAVE_PLATFORM_WAIT
using atomic_signed_lock_free
= atomic<make_signed_t<__detail::__platform_wait_t>>;
using atomic_unsigned_lock_free
= atomic<make_unsigned_t<__detail::__platform_wait_t>>;
-#elif ATOMIC_INT_LOCK_FREE || !(ATOMIC_LONG_LOCK_FREE || ATOMIC_CHAR_LOCK_FREE)
+# elif ATOMIC_INT_LOCK_FREE || !(ATOMIC_LONG_LOCK_FREE || ATOMIC_CHAR_LOCK_FREE)
using atomic_signed_lock_free = atomic<signed int>;
using atomic_unsigned_lock_free = atomic<unsigned int>;
-#elif ATOMIC_LONG_LOCK_FREE
+# elif ATOMIC_LONG_LOCK_FREE
using atomic_signed_lock_free = atomic<signed long>;
using atomic_unsigned_lock_free = atomic<unsigned long>;
-#elif ATOMIC_CHAR_LOCK_FREE
+# elif ATOMIC_CHAR_LOCK_FREE
using atomic_signed_lock_free = atomic<signed char>;
using atomic_unsigned_lock_free = atomic<unsigned char>;
+# else
+# error "libstdc++ bug: no lock-free atomics but they were emitted in <version>"
+# endif
#endif
-#endif // C++2a
-
/// @} group atomics
_GLIBCXX_END_NAMESPACE_VERSION
#include <bits/requires_hosted.h> // threading primitive
-#if __cplusplus > 201703L
+#define __glibcxx_want_barrier
+#include <bits/version.h>
+
+#ifdef __cpp_lib_barrier // C++ >= 20 && __cpp_aligned_new && lib_atomic_wait
#include <bits/atomic_base.h>
-#if __cpp_lib_atomic_wait && __cpp_aligned_new
#include <bits/std_thread.h>
#include <bits/unique_ptr.h>
#include <array>
-#define __cpp_lib_barrier 201907L
-
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#endif // __cpp_lib_atomic_wait && __cpp_aligned_new
-#endif // __cplusplus > 201703L
+#endif // __cpp_lib_barrier
#endif // _GLIBCXX_BARRIER
/// @endcond
#endif
+#define __glibcxx_want_bit_cast
+#define __glibcxx_want_byteswap
+#define __glibcxx_want_bitops
+#define __glibcxx_want_int_pow2
+#define __glibcxx_want_endian
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
* @{
*/
-#if __cplusplus > 201703l && __has_builtin(__builtin_bit_cast)
-#define __cpp_lib_bit_cast 201806L
+#ifdef __cpp_lib_bit_cast // C++ >= 20
/// Create a value of type `To` from the bits of `from`.
/**
{
return __builtin_bit_cast(_To, __from);
}
-#endif
+#endif // __cpp_lib_bit_cast
-#if __cplusplus > 202002L
-#define __cpp_lib_byteswap 202110L
+#ifdef __cpp_lib_byteswap // C++ >= 23
/// Reverse order of bytes in the object representation of `value`.
/**
}
return __val;
}
-#endif
+#endif // __cpp_lib_byteswap
/// @cond undocumented
/// @endcond
-#if __cplusplus > 201703L
-
-#define __cpp_lib_bitops 201907L
+#ifdef __cpp_lib_bitops // C++ >= 20
/// @cond undocumented
template<typename _Tp, typename _Up = _Tp>
constexpr _If_is_unsigned_integer<_Tp, int>
popcount(_Tp __x) noexcept
{ return std::__popcount(__x); }
+#endif // __cpp_lib_bitops
+#ifdef __cpp_lib_int_pow2 // C++ >= 20
// [bit.pow.two], integral powers of 2
-#define __cpp_lib_int_pow2 202002L
-
/// True if `x` is a power of two, false otherwise.
template<typename _Tp>
constexpr _If_is_unsigned_integer<_Tp, bool>
constexpr _If_is_unsigned_integer<_Tp, int>
bit_width(_Tp __x) noexcept
{ return std::__bit_width(__x); }
+#endif // defined (__cpp_lib_int_pow2)
-#define __cpp_lib_endian 201907L
+#ifdef __cpp_lib_endian // C++ >= 20
/// Byte order constants
/**
big = __ORDER_BIG_ENDIAN__,
native = __BYTE_ORDER__
};
-#endif // C++2a
+#endif // __cpp_lib_endian
/// @}
# include <bits/functional_hash.h>
#endif
+#define __glibcxx_want_constexpr_bitset
+#include <bits/version.h>
+
#define _GLIBCXX_BITSET_BITS_PER_WORD (__CHAR_BIT__ * __SIZEOF_LONG__)
#define _GLIBCXX_BITSET_WORDS(__n) \
((__n) / _GLIBCXX_BITSET_BITS_PER_WORD + \
{
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
-#if __cplusplus > 202002L && _GLIBCXX_HOSTED
-# define __cpp_lib_constexpr_bitset 202202L
-#endif
-
/**
* Base class, general case. It is a class invariant that _Nw will be
* nonnegative.
#include <bits/error_constants.h> // for std::errc
#include <ext/numeric_traits.h>
-#if _GLIBCXX_FLOAT_IS_IEEE_BINARY32 && _GLIBCXX_DOUBLE_IS_IEEE_BINARY64 \
- && __SIZE_WIDTH__ >= 32 && _GLIBCXX_HOSTED
-# define __cpp_lib_to_chars 201611L
-#endif
-
-#if __cplusplus > 202002L
-# define __cpp_lib_constexpr_charconv 202207L
-#endif
+#define __glibcxx_want_to_chars
+#define __glibcxx_want_constexpr_charconv
+#include <bits/version.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
# include <bits/unique_ptr.h>
#endif
-#if __cplusplus >= 202002L
-# undef __cpp_lib_chrono
-# define __cpp_lib_chrono 201907L
-#endif
-
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#pragma clang diagnostic ignored "-Wc99-extensions"
#endif
-#if __cplusplus > 201703L
-# define __cpp_lib_constexpr_complex 201711L
-#endif
+#define __glibcxx_want_constexpr_complex
+#define __glibcxx_want_complex_udls
+#include <bits/version.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
return std::complex<__type>(__x, -__type());
}
-#if __cplusplus > 201103L
+#ifdef __cpp_lib_complex_udls // C++ >= 14
inline namespace literals {
inline namespace complex_literals {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wliteral-suffix"
-#define __cpp_lib_complex_udls 201309L
constexpr std::complex<float>
operator""if(long double __num)
} // inline namespace complex_literals
} // inline namespace literals
-#endif // C++14
+#endif // __cpp_lib_complex_udls
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#ifndef _GLIBCXX_CONCEPTS
#define _GLIBCXX_CONCEPTS 1
-#if __cplusplus > 201703L && __cpp_concepts >= 201907L
-
#pragma GCC system_header
+#define __glibcxx_want_concepts
+#include <bits/version.h>
+
+#ifdef __cpp_lib_concepts // C++ >= 20 && concepts
/**
* @defgroup concepts Concepts
* @ingroup utilities
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_concepts 202002L
-
// [concepts.lang], language-related concepts
namespace __detail
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#endif // C++2a
+#endif // __cpp_lib_concepts
#endif /* _GLIBCXX_CONCEPTS */
#pragma GCC system_header
-// It is very likely that earlier versions would work, but they are untested.
-#if __cplusplus >= 201402L
+#define __glibcxx_want_coroutine
+#include <bits/version.h>
+
+#if !__cpp_impl_coroutine
+# error "the <coroutine> header requires -fcoroutines"
+#endif
+
+#ifdef __cpp_lib_coroutine // C++ >= 14 && impl_coroutine
#include <type_traits>
#if __cplusplus > 201703L
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#if __cpp_impl_coroutine
-
-#define __cpp_lib_coroutine 201902L
-
inline namespace __n4861 {
// C++20 17.12.2 coroutine traits
}
};
-#else
-#error "the <coroutine> header requires -fcoroutines"
-#endif
-
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++14 (we are allowing use from at least this)
+#endif // __cpp_lib_coroutine
#endif // _GLIBCXX_COROUTINE
#include <bits/range_access.h>
#include <bits/deque.tcc>
+#define __glibcxx_want_erase_if
+#include <bits/version.h>
+
#ifdef _GLIBCXX_DEBUG
# include <debug/deque>
#endif
} // namespace std
#endif // C++17
-#if __cplusplus > 201703L
+#ifdef __cpp_lib_erase_if // C++ >= 20 && erase_if
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_erase_if 202002L
-
template<typename _Tp, typename _Alloc, typename _Predicate>
inline typename deque<_Tp, _Alloc>::size_type
erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++20
+#endif // __cpp_lib_erase_if
#endif /* _GLIBCXX_DEQUE */
#include <bits/requires_hosted.h> // execution policies are hosted only
-#if __cplusplus >= 201703L
+#define __glibcxx_want_parallel_algorithm
+#define __glibcxx_want_execution
+#include <bits/version.h>
+
+// C++ >= 17 && HOSTED
+#if defined(__cpp_lib_parallel_algorithm) || defined(__cpp_lib_execution)
# include <bits/c++config.h>
# include <pstl/glue_execution_defs.h>
# include <pstl/glue_memory_impl.h>
# endif
-// Feature test macro for parallel algorithms
-# define __cpp_lib_parallel_algorithm 201603L
-# define __cpp_lib_execution 201902L
-
#endif // C++17
#endif /* _GLIBCXX_EXECUTION */
#pragma GCC system_header
-#if __cplusplus > 202002L && __cpp_concepts >= 202002L
+#define __glibcxx_want_expected
+#include <bits/version.h>
+#ifdef __cpp_lib_expected // C++ >= 23 && __cpp_concepts >= 202002L
#include <initializer_list>
#include <bits/exception.h> // exception
#include <bits/invoke.h> // __invoke
* @{
*/
-#define __cpp_lib_expected 202211L
-
/// Discriminated union that holds an expected value or an error value.
/**
* @since C++23
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++23
+#endif // __cpp_lib_expected
#endif // _GLIBCXX_EXPECTED
#include <bits/requires_hosted.h>
-#if __cplusplus >= 201703L
+#define __glibcxx_want_filesystem
+#include <bits/version.h>
+
+#ifdef __cpp_lib_filesystem // C++ >= 17 && HOSTED
/**
* @defgroup filesystem File System
#include <bits/fs_dir.h>
#include <bits/fs_ops.h>
-#define __cpp_lib_filesystem 201703L
-
-#endif // C++17
+#endif // __cpp_lib_filesystem
#endif // _GLIBCXX_FILESYSTEM
#include <bits/requires_hosted.h> // for std::string
-#if __cplusplus >= 202002L
+#define __glibcxx_want_format
+#include <bits/version.h>
+
+#ifdef __cpp_lib_format // C++ >= 20 && HOSTED
#include <array>
#include <charconv>
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-// 201907 Text Formatting, Integration of chrono, printf corner cases.
-// 202106 std::format improvements.
-// 202110 Fixing locale handling in chrono formatters, generator-like types.
-// 202207 Encodings in localized formatting of chrono, basic-format-string.
-#define __cpp_lib_format 202106L
-
-#if __cplusplus > 202002L
-// 202207 P2286R8 Formatting Ranges
-// 202207 P2585R1 Improving default container formatting
-// TODO: #define __cpp_lib_format_ranges 202207L
-#endif
-
// [format.context], class template basic_format_context
template<typename _Out, typename _CharT> class basic_format_context;
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++20
+#endif // __cpp_lib_format
#endif // _GLIBCXX_FORMAT
# include <debug/forward_list>
#endif
+#define __glibcxx_want_erase_if
+#include <bits/version.h>
+
#if __cplusplus >= 201703L
#include <bits/memory_resource.h>
namespace std _GLIBCXX_VISIBILITY(default)
} // namespace std
#endif // C++17
-#if __cplusplus > 201703L
+#ifdef __cpp_lib_erase_if // C++ >= 20 && HOSTED
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
-#define __cpp_lib_erase_if 202002L
-
template<typename _Tp, typename _Alloc, typename _Predicate>
inline typename forward_list<_Tp, _Alloc>::size_type
erase_if(forward_list<_Tp, _Alloc>& __cont, _Predicate __pred)
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++20
+#endif // __cpp_lib_erase_if
#endif // C++11
#include <bits/c++config.h>
#include <bits/stl_function.h> // std::equal_to, std::unary_function etc.
+#define __glibcxx_want_invoke
+#define __glibcxx_want_constexpr_functional
+#define __glibcxx_want_invoke_r
+#define __glibcxx_want_bind_front
+#define __glibcxx_want_not_fn
+#define __glibcxx_want_boyer_moore_searcher
+#include <bits/version.h>
+
#if __cplusplus >= 201103L
#include <tuple>
*/
template<int _Num> struct _Placeholder { };
-#if __cplusplus >= 201103L
-
-#if __cplusplus >= 201703L
-# define __cpp_lib_invoke 201411L
-# if __cplusplus > 201703L
-# define __cpp_lib_constexpr_functional 201907L
-# endif
+#ifdef __cpp_lib_invoke // C++ >= 17
/** Invoke a callable object.
*
return std::__invoke(std::forward<_Callable>(__fn),
std::forward<_Args>(__args)...);
}
+#endif
-#if __cplusplus > 202002L
-# define __cpp_lib_invoke_r 202106L
+#ifdef __cpp_lib_invoke_r // C++ >= 23
/** Invoke a callable object and convert the result to `_Res`.
*
return std::__invoke_r<_Res>(std::forward<_Callable>(__fn),
std::forward<_Args>(__args)...);
}
-#endif // C++23
-#endif // C++17
+#endif // __cpp_lib_invoke_r
/// @cond undocumented
+#if __cplusplus >= 201103L
template<typename _MemFunPtr,
bool __is_mem_fn = is_member_function_pointer<_MemFunPtr>::value>
class _Mem_fn_base
std::forward<_BoundArgs>(__args)...);
}
-#if __cplusplus > 201703L
-#define __cpp_lib_bind_front 201907L
+#ifdef __cpp_lib_bind_front // C++ >= 20
template<typename _Fd, typename... _BoundArgs>
struct _Bind_front
return _Bind_front_t<_Fn, _Args...>(0, std::forward<_Fn>(__fn),
std::forward<_Args>(__args)...);
}
-#endif // C++20
+#endif // __cpp_lib_bind_front
#if __cplusplus >= 201402L
/// Generalized negator.
template<>
struct __is_byte_like<byte, equal_to<void>>
: true_type { };
+#endif
// [func.not_fn] Function template not_fn
-#define __cpp_lib_not_fn 201603L
+#ifdef __cpp_lib_not_fn // C++ >= 17
/** Wrap a function object to create one that negates its result.
*
* The function template `std::not_fn` creates a "forwarding call wrapper",
{
return _Not_fn<std::decay_t<_Fn>>{std::forward<_Fn>(__fn), 0};
}
+#endif
+#if __cplusplus >= 201703L
// Searchers
template<typename _ForwardIterator1, typename _BinaryPredicate = equal_to<>>
tuple<_ForwardIterator1, _ForwardIterator1, _BinaryPredicate> _M_m;
};
-#if _GLIBCXX_HOSTED
-#define __cpp_lib_boyer_moore_searcher 201603L
+#ifdef __cpp_lib_boyer_moore_searcher // C++ >= 17 && HOSTED
template<typename _Key, typename _Tp, typename _Hash, typename _Pred>
struct __boyer_moore_map_base
}
return std::make_pair(__last, __last);
}
-#endif // HOSTED
+#endif // __cpp_lib_boyer_moore_searcher
#endif // C++17
#endif // C++14
#include <iosfwd>
#include <bits/ios_base.h>
+#define __glibcxx_want_quoted_string_io
+#include <bits/version.h>
+
#if __cplusplus >= 201103L
#include <locale>
#if __cplusplus > 201103L
return __is;
}
-#if __cplusplus >= 201402L
-
-#define __cpp_lib_quoted_string_io 201304L
+#ifdef __cpp_lib_quoted_string_io // C++ >= 14 && HOSTED
/**
* @brief Manipulator for quoted strings.
basic_string_view<_CharT, _Traits>, _CharT>(__sv, __delim, __escape);
}
#endif // C++17
-#endif // C++14
+#endif // __cpp_lib_quoted_string_io
#endif // __cplusplus >= 201103L
#endif
#include <bits/range_access.h>
-#if __cplusplus >= 201402L && ! defined _GLIBCXX_DEBUG // PR libstdc++/70303
-# define __cpp_lib_null_iterators 201304L
-#endif
+#define __glibcxx_want_null_iterators
+#include <bits/version.h>
#if __cplusplus >= 202002L
#include <bits/ranges_base.h> // ranges::distance, ranges::next, ranges::prev
#include <bits/requires_hosted.h> // concurrency
-#if __cplusplus > 201703L
+#define __glibcxx_want_latch
+#include <bits/version.h>
+#ifdef __cpp_lib_latch // C++ >= 20 && atomic_wait
#include <bits/atomic_base.h>
#include <ext/numeric_traits.h>
-#if __cpp_lib_atomic_wait
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_latch 201907L
-
class latch
{
public:
};
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#endif // __cpp_lib_atomic_wait
-#endif // __cplusplus > 201703L
+#endif // __cpp_lib_latch
#endif // _GLIBCXX_LATCH
# include <debug/list>
#endif
+#define __glibcxx_want_erase_if
+#include <bits/version.h>
+
#if __cplusplus >= 201703L
#include <bits/memory_resource.h>
namespace std _GLIBCXX_VISIBILITY(default)
} // namespace std
#endif // C++17
-#if __cplusplus > 201703L
+#ifdef __cpp_lib_erase_if // C++ >= 20 && HOSTED
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
-#define __cpp_lib_erase_if 202002L
-
template<typename _Tp, typename _Alloc, typename _Predicate>
inline typename list<_Tp, _Alloc>::size_type
erase_if(list<_Tp, _Alloc>& __cont, _Predicate __pred)
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++20
+#endif // __cpp_lib_erase_if
#endif /* _GLIBCXX_LIST */
# include <bits/uses_allocator_args.h>
#endif
-/* As a hack, we declare __cpp_lib_atomic_value_initialization here even though
- we don't include the bit that actually declares it, for consistency. */
-#if !defined(__cpp_lib_atomic_value_initialization) && __cplusplus >= 202002L
-# define __cpp_lib_atomic_value_initialization 201911L
-#endif
+#define __glibcxx_want_atomic_value_initialization
+#define __glibcxx_want_parallel_algorithm
+#include <bits/version.h>
#if __cplusplus >= 201103L && __cplusplus <= 202002L && _GLIBCXX_HOSTED
namespace std _GLIBCXX_VISIBILITY(default)
} // namespace
#endif // C++11 to C++20
-#if __cplusplus >= 201703L && _GLIBCXX_HOSTED
+#ifdef __cpp_lib_parallel_algorithm // C++ >= 17 && HOSTED
// Parallel STL algorithms
# if _PSTL_EXECUTION_POLICIES_DEFINED
// If <execution> has already been included, pull in implementations
// Otherwise just pull in forward declarations
# include <pstl/glue_memory_defs.h>
# endif
-
-// Feature test macro for parallel algorithms
-# define __cpp_lib_parallel_algorithm 201603L
-#endif // C++17
+#endif // __cpp_lib_parallel_algorithm
#endif /* _GLIBCXX_MEMORY */
#include <bits/requires_hosted.h> // polymorphic allocation
+#define __glibcxx_want_polymorphic_allocator
+#define __glibcxx_want_memory_resource
+#include <bits/version.h>
+
#if __cplusplus >= 201703L
/**
_GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace pmr
{
-#ifdef _GLIBCXX_HAS_GTHREADS
- // Header and all contents are present.
-# define __cpp_lib_memory_resource 201603L
-#else
- // The pmr::synchronized_pool_resource type is missing.
-# define __cpp_lib_memory_resource 1
-#endif
-#if __cplusplus >= 202002L
-# define __cpp_lib_polymorphic_allocator 201902L
+#ifdef __cpp_lib_polymorphic_allocator // C++ >= 20 && HOSTED
template<typename _Tp = std::byte>
class polymorphic_allocator;
#endif
// Pool resource classes
struct pool_options;
-#ifdef _GLIBCXX_HAS_GTHREADS
+#if __cpp_lib_memory_resource >= 201603L // C++ >= 17 && hosted && gthread
class synchronized_pool_resource;
#endif
class unsynchronized_pool_resource;
const int _M_npools;
};
-#ifdef _GLIBCXX_HAS_GTHREADS
+#if __cpp_lib_memory_resource >= 201603L // C++ >= 17 && hosted && gthread
/// A thread-safe memory resource that manages pools of fixed-size blocks.
/**
* @ingroup pmr
_TPools* _M_tpools = nullptr;
mutable shared_mutex _M_mx;
};
-#endif
+#endif // __cpp_lib_memory_resource >= 201603L
/// A non-thread-safe memory resource that manages pools of fixed-size blocks.
/**
# include <bits/std_function.h> // std::function
#endif
+#define __glibcxx_want_scoped_lock
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
}
}
-#if __cplusplus >= 201703L
-#define __cpp_lib_scoped_lock 201703L
+#ifdef __cpp_lib_scoped_lock // C++ >= 17 && hosted && gthread
/** @brief A scoped lock type for multiple lockable objects.
*
* A scoped_lock controls mutex ownership within a scope, releasing
private:
mutex_type& _M_device;
};
-#endif // C++17
+#endif // __cpp_lib_scoped_lock
#ifdef _GLIBCXX_HAS_GTHREADS
/// Flag type used by std::call_once
#pragma GCC system_header
-#if __cplusplus > 201703L
+#define __glibcxx_want_math_constants
+#include <bits/version.h>
+
+#ifdef __cpp_lib_math_constants // C++ >= 20
#include <type_traits>
/// Namespace for mathematical constants
namespace numbers
{
-#define __cpp_lib_math_constants 201907L
/// @cond undocumented
template<typename _Tp>
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++20
+#endif // __cpp_lib_math_constants
#endif // _GLIBCXX_NUMBERS
# include <limits>
#endif
+#define __glibcxx_want_constexpr_numeric
+#define __glibcxx_want_gcd
+#define __glibcxx_want_gcd_lcm
+#define __glibcxx_want_interpolate
+#define __glibcxx_want_lcm
+#define __glibcxx_want_parallel_algorithm
+#include <bits/version.h>
+
/**
* @defgroup numerics Numerics
*
}
}
} // namespace __detail
+#endif // C++14
-#if __cplusplus >= 201703L
-
-#define __cpp_lib_gcd_lcm 201606L
-// These were used in drafts of SD-6:
-#define __cpp_lib_gcd 201606L
-#define __cpp_lib_lcm 201606L
-
+#ifdef __cpp_lib_gcd_lcm // C++ >= 17
/// Greatest common divisor
template<typename _Mn, typename _Nn>
constexpr common_type_t<_Mn, _Nn>
return __r;
}
-#endif // C++17
-#endif // C++14
-
-#if __cplusplus > 201703L
+#endif // __cpp_lib_gcd_lcm
// midpoint
-# define __cpp_lib_interpolate 201902L
-
+#ifdef __cpp_lib_interpolate // C++ >= 20
template<typename _Tp>
constexpr
enable_if_t<__and_v<is_arithmetic<_Tp>, is_same<remove_cv_t<_Tp>, _Tp>,
static_assert( sizeof(_Tp) != 0, "type must be complete" );
return __a + (__b - __a) / 2;
}
-#endif // C++20
+#endif // __cpp_lib_interpolate
#if __cplusplus >= 201703L
-
-#if __cplusplus > 201703L
-#define __cpp_lib_constexpr_numeric 201911L
-#endif
-
/// @addtogroup numeric_ops
/// @{
# include <pstl/glue_numeric_defs.h>
# define _PSTL_NUMERIC_FORWARD_DECLARED 1
# endif
-
-// Feature test macro for parallel algorithms
-# define __cpp_lib_parallel_algorithm 201603L
#endif // C++17
#endif /* _GLIBCXX_NUMERIC */
#pragma GCC system_header
-#if __cplusplus >= 201703L
+#define __glibcxx_want_optional
+#include <bits/version.h>
+
+#ifdef __cpp_lib_optional // C++ >= 17
#include <type_traits>
#include <exception>
* @{
*/
-#if __cplusplus > 202002L && __cpp_lib_concepts
-# define __cpp_lib_optional 202110L
-#elif __cplusplus >= 202002L
-# define __cpp_lib_optional 202106L
-#else
-# define __cpp_lib_optional 201606L
-#endif
-
template<typename _Tp>
class optional;
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++17
+#endif // __cpp_lib_optional
#endif // _GLIBCXX_OPTIONAL
#include <bits/ranges_util.h>
#include <bits/refwrap.h>
+#define __glibcxx_want_ranges_as_const
+#define __glibcxx_want_ranges_as_rvalue
+#define __glibcxx_want_ranges_cartesian_product
+#define __glibcxx_want_ranges_chunk
+#define __glibcxx_want_ranges_chunk_by
+#define __glibcxx_want_ranges_enumerate
+#define __glibcxx_want_ranges_iota
+#define __glibcxx_want_ranges_iota
+#define __glibcxx_want_ranges_join_with
+#define __glibcxx_want_ranges_repeat
+#define __glibcxx_want_ranges_slide
+#define __glibcxx_want_ranges_stride
+#define __glibcxx_want_ranges_zip
+#include <bits/version.h>
+
/**
* @defgroup ranges Ranges
*
inline constexpr auto values = elements<1>;
} // namespace views
-#if __cplusplus > 202002L
-
-#define __cpp_lib_ranges_zip 202110L
-
+#ifdef __cpp_lib_ranges_zip // C++ >= 23
namespace __detail
{
template<typename... _Rs>
inline constexpr auto pairwise_transform = adjacent_transform<2>;
}
+#endif // __cpp_lib_ranges_zip
-#define __cpp_lib_ranges_chunk 202202L
-
+#ifdef __cpp_lib_ranges_chunk // C++ >= 23
namespace __detail
{
template<typename _Tp>
inline constexpr _Chunk chunk;
}
+#endif // __cpp_lib_ranges_chunk
-#define __cpp_lib_ranges_slide 202202L
-
+#ifdef __cpp_lib_ranges_slide // C++ >= 23
namespace __detail
{
template<typename _Vp>
inline constexpr _Slide slide;
}
+#endif // __cpp_lib_ranges_slide
-#define __cpp_lib_ranges_chunk_by 202202L
-
+#ifdef __cpp_lib_ranges_chunk_by // C++ >= 23
template<forward_range _Vp,
indirect_binary_predicate<iterator_t<_Vp>, iterator_t<_Vp>> _Pred>
requires view<_Vp> && is_object_v<_Pred>
inline constexpr _ChunkBy chunk_by;
}
+#endif // __cpp_lib_ranges_chunk_by
-#define __cpp_lib_ranges_join_with 202202L
-
+#ifdef __cpp_lib_ranges_join_with // C++ >= 23
namespace __detail
{
template<typename _Range, typename _Pattern>
inline constexpr _JoinWith join_with;
} // namespace views
+#endif // __cpp_lib_ranges_join_with
-#define __cpp_lib_ranges_repeat 202207L
-
+#ifdef __cpp_lib_ranges_repeat // C++ >= 32
template<copy_constructible _Tp, semiregular _Bound = unreachable_sentinel_t>
requires is_object_v<_Tp> && same_as<_Tp, remove_cv_t<_Tp>>
&& (__detail::__is_integer_like<_Bound> || same_as<_Bound, unreachable_sentinel_t>)
}
}
}
+#endif // __cpp_lib_ranges_repeat
-#define __cpp_lib_ranges_stride 202207L
-
+#ifdef __cpp_lib_ranges_stride // C++ >= 23
template<input_range _Vp>
requires view<_Vp>
class stride_view : public view_interface<stride_view<_Vp>>
inline constexpr _Stride stride;
}
+#endif // __cpp_lib_ranges_stride
-#define __cpp_lib_ranges_cartesian_product 202207L
-
+#ifdef __cpp_lib_ranges_cartesian_product // C++ >= 23
namespace __detail
{
template<bool _Const, typename _First, typename... _Vs>
inline constexpr _CartesianProduct cartesian_product;
}
+#endif // __cpp_lib_ranges_cartesian_product
-#define __cpp_lib_ranges_as_rvalue 202207L
-
+#ifdef __cpp_lib_ranges_as_rvalue // C++ >= 23
template<input_range _Vp>
requires view<_Vp>
class as_rvalue_view : public view_interface<as_rvalue_view<_Vp>>
inline constexpr _AsRvalue as_rvalue;
}
+#endif // __cpp_lib_as_rvalue
-#define __cpp_lib_ranges_enumerate 202302L
-
+#ifdef __cpp_lib_ranges_enumerate // C++ >= 23
namespace __detail
{
template<typename _Range>
inline constexpr _Enumerate enumerate;
}
+#endif // __cpp_lib_ranges_enumerate
-#define __cpp_lib_ranges_as_const 202207L
-
+#ifdef __cpp_lib_ranges_as_const // C++ >= 23
template<view _Vp>
requires input_range<_Vp>
class as_const_view : public view_interface<as_const_view<_Vp>>
inline constexpr _AsConst as_const;
}
-#endif // C++23
+#endif // __cpp_lib_as_const
} // namespace ranges
namespace views = ranges::views;
#if __cplusplus > 201703L
#include <bits/semaphore_base.h>
-#if __cpp_lib_atomic_wait || _GLIBCXX_HAVE_POSIX_SEMAPHORE
+#define __glibcxx_want_semaphore
+#include <bits/version.h>
+
+#ifdef __cpp_lib_semaphore // C++ >= 20 && hosted && (atomic_wait || posix_sem)
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_semaphore 201907L
-
template<ptrdiff_t __least_max_value = __semaphore_impl::_S_max>
class counting_semaphore
{
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#endif // cpp_lib_atomic_wait || _GLIBCXX_HAVE_POSIX_SEMAPHORE
-#endif // C++20
+#endif // __cpp_lib_semaphore
#endif // _GLIBCXX_SEMAPHORE
#include <bits/move.h> // move, __exchange
#include <bits/std_mutex.h> // defer_lock_t
+#define __glibcxx_want_shared_mutex
+#define __glibcxx_want_shared_timed_mutex
+#include <bits/version.h>
+
#if ! (_GLIBCXX_USE_PTHREAD_RWLOCK_T && _GTHREAD_USE_MUTEX_TIMEDLOCK)
# include <condition_variable>
#endif
#ifdef _GLIBCXX_HAS_GTHREADS
-#if __cplusplus >= 201703L
-#define __cpp_lib_shared_mutex 201505L
+#ifdef __cpp_lib_shared_mutex // C++ >= 17 && hosted && gthread
class shared_mutex;
#endif
-#define __cpp_lib_shared_timed_mutex 201402L
class shared_timed_mutex;
/// @cond undocumented
#endif
/// @endcond
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_shared_mutex
/// The standard shared mutex type.
class shared_mutex
{
__shared_mutex_cv _M_impl;
#endif
};
-#endif // C++17
+#endif // __cpp_lib_shared_mutex
/// @cond undocumented
#if _GLIBCXX_USE_PTHREAD_RWLOCK_T && _GTHREAD_USE_MUTEX_TIMEDLOCK
#ifndef _GLIBCXX_SRCLOC
#define _GLIBCXX_SRCLOC 1
-#if __cplusplus > 201703L && __has_builtin(__builtin_source_location)
+#define __glibcxx_want_source_location
+#include <bits/version.h>
+
+#if __cpp_lib_source_location // C++ >= 20 && builtin_source_location
#include <bits/c++config.h>
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_source_location 201907L
-
/// A class that describes a location in source code.
struct source_location
{
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++20 && __builtin_source_location
+#endif // __cpp_lib_source_location
#endif // _GLIBCXX_SRCLOC
#pragma GCC system_header
-#if __cplusplus > 201703L
+#define __glibcxx_want_span
+#include <bits/version.h>
+#ifdef __cpp_lib_span // C++ >= 20 && concepts
#include <array>
#include <cstddef>
#include <bits/stl_iterator.h>
#include <bits/ranges_base.h>
-
-#if __cpp_lib_concepts
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_span 202002L
-
inline constexpr size_t dynamic_extent = static_cast<size_t>(-1);
template<typename _Type, size_t _Extent>
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // concepts
-#endif // C++20
+#endif // __cpp_lib_span
#endif // _GLIBCXX_SPAN
#include <bits/requires_hosted.h> // iostreams
-#if __cplusplus > 202002L
+#define __glibcxx_want_spanstream
+#include <bits/version.h>
+
+#ifdef __cpp_lib_spanstream // C++ >= 23 && hosted && lib_span
#include <span>
#include <streambuf>
#include <istream>
#include <ostream>
#include <bits/ranges_base.h>
-#if __cpp_lib_span
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_spanstream 202106L
-
template<typename _CharT, typename _Traits>
class basic_spanbuf
: public basic_streambuf<_CharT, _Traits>
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // __cpp_lib_span
-#endif // C++23
+#endif // __cpp_lib_spanstream
#endif // _GLIBCXX_SPANSTREAM
#include <bits/c++config.h>
-#if __cplusplus > 202002L && _GLIBCXX_HAVE_STACKTRACE
+#define __glibcxx_want_stacktrace
+#include <bits/version.h>
+
+#ifdef __cpp_lib_stacktrace // C++ >= 23 && hosted && HAVE_STACKTRACE
#include <compare>
#include <new>
#include <string>
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_stacktrace 202011L
-
// [stacktrace.entry], class stacktrace_entry
class stacktrace_entry
{
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++23
-
+#endif // __cpp_lib_stacktrace
#endif /* _GLIBCXX_STACKTRACE */
#include <bits/requires_hosted.h> // concurrency
+#define __glibcxx_want_jthread
+#include <bits/version.h>
+
#if __cplusplus > 201703L
#include <atomic>
#include <semaphore>
-#define __cpp_lib_jthread 201911L
-
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#include <bits/basic_string.h>
#include <bits/basic_string.tcc>
+#define __glibcxx_want_erase_if
+#include <bits/version.h>
+
#if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI
#include <bits/memory_resource.h>
namespace std _GLIBCXX_VISIBILITY(default)
} // namespace std
#endif // C++17
-#if __cplusplus > 201703L
+#ifdef __cpp_lib_erase_if // C++ >= 20 && HOSTED
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_erase_if 202002L
-
template<typename _CharT, typename _Traits, typename _Alloc,
typename _Predicate>
_GLIBCXX20_CONSTEXPR
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++20
+#endif // __cpp_lib_erase_if
#endif /* _GLIBCXX_STRING */
#pragma GCC system_header
+#define __glibcxx_want_string_view
+#define __glibcxx_want_constexpr_string_view
+#define __glibcxx_want_starts_ends_with
+#define __glibcxx_want_string_contains
+#include <bits/version.h>
+
#if __cplusplus >= 201703L
#include <bits/char_traits.h>
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#if _GLIBCXX_HOSTED
-# define __cpp_lib_string_view 201803L
-#endif
-
-#if __cplusplus > 201703L
-# define __cpp_lib_constexpr_string_view 201811L
-#endif
-
// Helper for basic_string and basic_string_view members.
constexpr size_t
__sv_check(size_t __size, size_t __pos, const char* __s)
.compare(basic_string_view(__str, __n2));
}
-#if __cplusplus > 201703L
-#define __cpp_lib_starts_ends_with 201711L
+#ifdef __cpp_lib_starts_ends_with // C++ >= 20
[[nodiscard]]
constexpr bool
starts_with(basic_string_view __x) const noexcept
constexpr bool
ends_with(const _CharT* __x) const noexcept
{ return this->ends_with(basic_string_view(__x)); }
-#endif // C++20
+#endif // __cpp_lib_starts_ends_with
#if __cplusplus > 202002L
-#if _GLIBCXX_HOSTED
+#if _GLIBCXX_HOSTED && !defined(__cpp_lib_string_contains)
// This FTM is not freestanding as it also implies matching <string>
// support, and <string> is omitted from the freestanding subset.
-# define __cpp_lib_string_contains 202011L
+# error "libstdc++ bug: string_contains not defined when it should be"
#endif // HOSTED
[[nodiscard]]
constexpr bool
#ifndef _GLIBCXX_SYNCSTREAM
#define _GLIBCXX_SYNCSTREAM 1
-#if __cplusplus > 201703L
-
-#include <bits/c++config.h>
-#if _GLIBCXX_USE_CXX11_ABI
-
-#define __cpp_lib_syncbuf 201803L
-
#pragma GCC system_header
#include <bits/requires_hosted.h> // iostreams
+#include <bits/c++config.h>
+
+#define __glibcxx_want_syncbuf
+#include <bits/version.h>
+
+#ifdef __cpp_lib_syncbuf // C++ >= 20 && HOSTED && CXX11ABI
#include <sstream>
#include <bits/alloc_traits.h>
using wosyncstream = basic_osyncstream<wchar_t>;
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // _GLIBCXX_USE_CXX11_ABI
-#endif // C++2a
+#endif // __cpp_lib_syncbuf
+
#endif /* _GLIBCXX_SYNCSTREAM */
#include <bits/std_thread.h> // std::thread, get_id, yield
#include <bits/this_thread_sleep.h> // std::this_thread::sleep_for, sleep_until
+#define __glibcxx_want_jthread
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus > 201703L
# include <compare>
# include <bits/ranges_util.h> // for std::ranges::subrange
-# define __cpp_lib_constexpr_tuple 201811L
#endif
+#define __glibcxx_want_constexpr_tuple
+#define __glibcxx_want_tuples_by_type
+#define __glibcxx_want_apply
+#define __glibcxx_want_make_from_tuple
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
get(const tuple<_Elements...>&) = delete;
/// @endcond
-#if __cplusplus >= 201402L
-
-#define __cpp_lib_tuples_by_type 201304L
-
+#ifdef __cpp_lib_tuples_by_type // C++ >= 14
/// Return a reference to the unique element of type _Tp of a tuple.
template <typename _Tp, typename... _Types>
constexpr _Tp&
second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...)
{ }
-#if __cplusplus >= 201703L
-
+#if defined(__cpp_lib_apply) || defined(__cpp_lib_make_from_tuple) // C++ >= 17
// Unpack a std::tuple into a type trait and use its value.
// For cv std::tuple<_Up> the result is _Trait<_Tp, cv _Up...>::value.
// For cv std::tuple<_Up>& the result is _Trait<_Tp, cv _Up&...>::value.
template<template<typename...> class _Trait, typename _Tp, typename... _Up>
inline constexpr bool __unpack_std_tuple<_Trait, _Tp, const tuple<_Up...>&>
= _Trait<_Tp, const _Up&...>::value;
+#endif
-# define __cpp_lib_apply 201603L
-
+#ifdef __cpp_lib_apply // C++ >= 17
template <typename _Fn, typename _Tuple, size_t... _Idx>
constexpr decltype(auto)
__apply_impl(_Fn&& __f, _Tuple&& __t, index_sequence<_Idx...>)
std::forward<_Tuple>(__t),
_Indices{});
}
+#endif
-#define __cpp_lib_make_from_tuple 201606L
-
+#ifdef __cpp_lib_make_from_tuple // C++ >= 17
template <typename _Tp, typename _Tuple, size_t... _Idx>
constexpr _Tp
__make_from_tuple_impl(_Tuple&& __t, index_sequence<_Idx...>)
return __make_from_tuple_impl<_Tp>(std::forward<_Tuple>(__t),
make_index_sequence<__n>{});
}
-#endif // C++17
+#endif
#if __cplusplus > 202002L
template<typename... _TTypes, typename... _UTypes,
#include <bits/c++config.h>
+#define __glibcxx_want_bool_constant
+#define __glibcxx_want_bounded_array_traits
+#define __glibcxx_want_has_unique_object_representations
+#define __glibcxx_want_integral_constant_callable
+#define __glibcxx_want_is_aggregate
+#define __glibcxx_want_is_constant_evaluated
+#define __glibcxx_want_is_final
+#define __glibcxx_want_is_invocable
+#define __glibcxx_want_is_layout_compatible
+#define __glibcxx_want_is_nothrow_convertible
+#define __glibcxx_want_is_null_pointer
+#define __glibcxx_want_is_pointer_interconvertible
+#define __glibcxx_want_is_scoped_enum
+#define __glibcxx_want_is_swappable
+#define __glibcxx_want_logical_traits
+#define __glibcxx_want_reference_from_temporary
+#define __glibcxx_want_remove_cvref
+#define __glibcxx_want_result_of_sfinae
+#define __glibcxx_want_transformation_trait_aliases
+#define __glibcxx_want_type_identity
+#define __glibcxx_want_type_trait_variable_templates
+#define __glibcxx_want_unwrap_ref
+#define __glibcxx_want_void_t
+#include <bits/version.h>
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
using value_type = _Tp;
using type = integral_constant<_Tp, __v>;
constexpr operator value_type() const noexcept { return value; }
-#if __cplusplus > 201103L
-
-#define __cpp_lib_integral_constant_callable 201304L
+#ifdef __cpp_lib_integral_constant_callable // C++ >= 14
constexpr value_type operator()() const noexcept { return value; }
#endif
};
/// The type used as a compile-time boolean with false value.
using false_type = __bool_constant<false>;
-#if __cplusplus >= 201703L
-# define __cpp_lib_bool_constant 201505L
+#ifdef __cpp_lib_bool_constant // C++ >= 17
/// Alias template for compile-time boolean constant types.
/// @since C++17
template<bool __v>
{ };
/// @endcond
-#if __cplusplus >= 201703L
+#ifdef __cpp_lib_logical_traits // C++ >= 17
/// @cond undocumented
template<typename... _Bn>
} // namespace __detail
/// @endcond
-#define __cpp_lib_logical_traits 201510L
-
template<typename... _Bn>
struct conjunction
: __detail::__conjunction_impl<void, _Bn...>::type
inline constexpr bool negation_v = negation<_Pp>::value;
/// @}
-#endif // C++17
+#endif // __cpp_lib_logical_traits
// Forward declarations
template<typename>
struct is_function<_Tp&&>
: public false_type { };
-#define __cpp_lib_is_null_pointer 201309L
-
+#ifdef __cpp_lib_is_null_pointer // C++ >= 11
/// is_null_pointer (LWG 2247).
template<typename _Tp>
struct is_null_pointer
struct __is_nullptr_t
: public is_null_pointer<_Tp>
{ } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
+#endif // __cpp_lib_is_null_pointer
// Composite type categories.
: public __bool_constant<__is_polymorphic(_Tp)>
{ };
-#if __cplusplus >= 201402L
-#define __cpp_lib_is_final 201402L
+#ifdef __cpp_lib_is_final // C++ >= 14
/// is_final
/// @since C++14
template<typename _Tp>
using __is_array_convertible
= is_convertible<_FromElementType(*)[], _ToElementType(*)[]>;
-#if __cplusplus >= 202002L
-#define __cpp_lib_is_nothrow_convertible 201806L
+#ifdef __cpp_lib_is_nothrow_convertible // C++ >= 20
#if __has_builtin(__is_nothrow_convertible)
/// is_nothrow_convertible_v
inline constexpr bool is_nothrow_convertible_v
= is_nothrow_convertible<_From, _To>::value;
#endif
-#endif // C++2a
+#endif // __cpp_lib_is_nothrow_convertible
// Const-volatile modifications.
struct add_cv
{ using type = _Tp const volatile; };
-#if __cplusplus > 201103L
-
-#define __cpp_lib_transformation_trait_aliases 201304L
-
+#ifdef __cpp_lib_transformation_trait_aliases // C++ >= 14
/// Alias template for remove_const
template<typename _Tp>
using remove_const_t = typename remove_const<_Tp>::type;
// Sfinae-friendly result_of implementation:
-#define __cpp_lib_result_of_sfinae 201210L
-
/// @cond undocumented
struct __invoke_memfun_ref { };
struct __invoke_memfun_deref { };
using result_of_t = typename result_of<_Tp>::type;
#endif // C++14
-#if __cplusplus >= 201703L || !defined(__STRICT_ANSI__) // c++17 or gnu++11
-#define __cpp_lib_void_t 201411L
+#ifdef __cpp_lib_void_t // C++ >= 17 || GNU++ >= 11
/// A metafunction that always yields void, used for detecting valid types.
template<typename...> using void_t = void;
#endif
{ };
/// @endcond
-#if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11
-#define __cpp_lib_is_swappable 201603L
+#ifdef __cpp_lib_is_swappable // C++ >= 17 || GNU++ >= 11
/// Metafunctions used for detecting swappable types: p0185r1
/// is_swappable
is_nothrow_swappable_with<_Tp, _Up>::value;
#endif // __cplusplus >= 201402L
-#endif// c++1z or gnu++11
+#endif // __cpp_lib_is_swappable
/// @cond undocumented
#pragma GCC diagnostic pop
/// @endcond
-#if __cplusplus >= 201703L
-# define __cpp_lib_is_invocable 201703L
-
+#ifdef __cpp_lib_is_invocable // C++ >= 17
/// std::invoke_result
template<typename _Functor, typename... _ArgTypes>
struct invoke_result
static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
"_Ret must be a complete class or an unbounded array");
};
-#endif // C++17
+#endif // __cpp_lib_is_invocable
-#if __cplusplus >= 201703L
-# define __cpp_lib_type_trait_variable_templates 201510L
+#if __cpp_lib_type_trait_variable_templates // C++ >= 17
/**
* @defgroup variable_templates Variable templates for type traits
* @ingroup metaprogramming
inline constexpr bool is_nothrow_invocable_r_v
= is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
/// @}
+#endif // __cpp_lib_type_trait_variable_templates
-#ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
-# define __cpp_lib_has_unique_object_representations 201606L
+#ifdef __cpp_lib_has_unique_object_representations // C++ >= 17 && HAS_UNIQ_OBJ_REP
/// has_unique_object_representations
/// @since C++17
template<typename _Tp>
"template argument must be a complete class or an unbounded array");
};
+# if __cpp_lib_type_trait_variable_templates // C++ >= 17
/// @ingroup variable_templates
template<typename _Tp>
inline constexpr bool has_unique_object_representations_v
= has_unique_object_representations<_Tp>::value;
+# endif
#endif
-#ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
-# define __cpp_lib_is_aggregate 201703L
+#ifdef __cpp_lib_is_aggregate // C++ >= 17 && builtin_is_aggregate
/// is_aggregate - true if the type is an aggregate.
/// @since C++17
template<typename _Tp>
: bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
{ };
+# if __cpp_lib_type_trait_variable_templates // C++ >= 17
/** is_aggregate_v - true if the type is an aggregate.
* @ingroup variable_templates
* @since C++17
*/
template<typename _Tp>
inline constexpr bool is_aggregate_v = __is_aggregate(remove_cv_t<_Tp>);
+# endif
#endif
-#endif // C++17
-
-#if __cplusplus >= 202002L
/** * Remove references and cv-qualifiers.
* @since C++20
* @{
*/
-#define __cpp_lib_remove_cvref 201711L
-
-#if __has_builtin(__remove_cvref)
+#ifdef __cpp_lib_remove_cvref // C++ >= 20
+# if __has_builtin(__remove_cvref)
template<typename _Tp>
struct remove_cvref
{ using type = __remove_cvref(_Tp); };
-#else
+# else
template<typename _Tp>
struct remove_cvref
{ using type = typename remove_cv<_Tp>::type; };
template<typename _Tp>
struct remove_cvref<_Tp&&>
{ using type = typename remove_cv<_Tp>::type; };
-#endif
+# endif
template<typename _Tp>
using remove_cvref_t = typename remove_cvref<_Tp>::type;
/// @}
+#endif // __cpp_lib_remove_cvref
+#ifdef __cpp_lib_type_identity // C++ >= 20
/** * Identity metafunction.
* @since C++20
* @{
*/
-#define __cpp_lib_type_identity 201806L
template<typename _Tp>
struct type_identity { using type = _Tp; };
template<typename _Tp>
using type_identity_t = typename type_identity<_Tp>::type;
/// @}
+#endif
-#define __cpp_lib_unwrap_ref 201811L
-
+#ifdef __cpp_lib_unwrap_ref // C++ >= 20
/** Unwrap a reference_wrapper
* @since C++20
* @{
template<typename _Tp>
using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type;
/// @}
+#endif // __cpp_lib_unwrap_ref
-#define __cpp_lib_bounded_array_traits 201902L
-
+#ifdef __cpp_lib_bounded_array_traits // C++ >= 20
/// True for a type that is an array of known bound.
/// @ingroup variable_templates
/// @since C++20
struct is_unbounded_array
: public bool_constant<is_unbounded_array_v<_Tp>>
{ };
+#endif // __cpp_lib_bounded_array_traits
-#if __has_builtin(__is_layout_compatible)
+#if __has_builtin(__is_layout_compatible) && __cplusplus >= 202002L
/// @since C++20
template<typename _Tp, typename _Up>
= __is_layout_compatible(_Tp, _Up);
#if __has_builtin(__builtin_is_corresponding_member)
-#define __cpp_lib_is_layout_compatible 201907L
+# ifndef __cpp_lib_is_layout_compatible
+# error "libstdc++ bug: is_corresponding_member and is_layout_compatible are provided but their FTM is not set"
+# endif
/// @since C++20
template<typename _S1, typename _S2, typename _M1, typename _M2>
#endif
#endif
-#if __has_builtin(__is_pointer_interconvertible_base_of)
+#if __has_builtin(__is_pointer_interconvertible_base_of) \
+ && __cplusplus >= 202002L
/// True if `_Derived` is standard-layout and has a base class of type `_Base`
/// @since C++20
template<typename _Base, typename _Derived>
= __is_pointer_interconvertible_base_of(_Base, _Derived);
#if __has_builtin(__builtin_is_pointer_interconvertible_with_class)
-#define __cpp_lib_is_pointer_interconvertible 201907L
+# ifndef __cpp_lib_is_pointer_interconvertible
+# error "libstdc++ bug: is_pointer_interconvertible available but FTM is not set"
+# endif
/// True if `__mp` points to the first member of a standard-layout type
/// @returns true if `s.*__mp` is pointer-interconvertible with `s`
#endif
#endif
-#if __cplusplus > 202002L
-#define __cpp_lib_is_scoped_enum 202011L
-
+#ifdef __cpp_lib_is_scoped_enum // C++ >= 23
/// True if the type is a scoped enumeration type.
/// @since C++23
/// @since C++23
template<typename _Tp>
inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
+#endif
-#if __has_builtin(__reference_constructs_from_temporary) \
- && __has_builtin(__reference_converts_from_temporary)
-
-#define __cpp_lib_reference_from_temporary 202202L
-
+#ifdef __cpp_lib_reference_from_temporary // C++ >= 23 && ref_{converts,constructs}_from_temp
/// True if _Tp is a reference type, a _Up value can be bound to _Tp in
/// direct-initialization, and a temporary object would be bound to
/// the reference, false otherwise.
template<typename _Tp, typename _Up>
inline constexpr bool reference_converts_from_temporary_v
= reference_converts_from_temporary<_Tp, _Up>::value;
-#endif // __has_builtin for reference_from_temporary
-#endif // C++23
-
-#if _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
-#define __cpp_lib_is_constant_evaluated 201811L
+#endif // __cpp_lib_reference_from_temporary
+#ifdef __cpp_lib_is_constant_evaluated // C++ >= 20 && HAVE_IS_CONST_EVAL
/// Returns true only when called during constant evaluation.
/// @since C++20
constexpr inline bool
}
#endif
+#if __cplusplus >= 202002L
/// @cond undocumented
template<typename _From, typename _To>
using __copy_cv = typename __match_cv_qualifiers<_From, _To>::__type;
#include <bits/stl_relops.h>
#include <bits/stl_pair.h>
+#define __glibcxx_want_exchange_function
+#define __glibcxx_want_constexpr_algorithms
+#define __glibcxx_want_as_const
+#define __glibcxx_want_integer_comparison_functions
+#define __glibcxx_want_to_underlying
+#define __glibcxx_want_unreachable
+#include <bits/version.h>
+
#if __cplusplus >= 201103L
#include <initializer_list>
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#if __cplusplus >= 201402L
-#define __cpp_lib_exchange_function 201304L
-
-#if __cplusplus > 201703L
-# define __cpp_lib_constexpr_algorithms 201806L
-#endif
-
+#ifdef __cpp_lib_exchange_function // C++ >= 14
/// Assign @p __new_val to @p __obj and return its previous value.
template <typename _Tp, typename _Up = _Tp>
_GLIBCXX20_CONSTEXPR
noexcept(__and_<is_nothrow_move_constructible<_Tp>,
is_nothrow_assignable<_Tp&, _Up>>::value)
{ return std::__exchange(__obj, std::forward<_Up>(__new_val)); }
+#endif
-#if __cplusplus >= 201703L
-
-#define __cpp_lib_as_const 201510L
+#ifdef __cpp_lib_as_const // C++ >= 17
template<typename _Tp>
[[nodiscard]]
constexpr add_const_t<_Tp>&
template<typename _Tp>
void as_const(const _Tp&&) = delete;
+#endif
-#if __cplusplus > 201703L
-#define __cpp_lib_integer_comparison_functions 202002L
-
+#ifdef __cpp_lib_integer_comparison_functions // C++ >= 20
template<typename _Tp, typename _Up>
constexpr bool
cmp_equal(_Tp __t, _Up __u) noexcept
else
return __t <= make_unsigned_t<_Up>(__int_traits<_Up>::__max);
}
+#endif // __cpp_lib_integer_comparison_functions
-#if __cplusplus > 202002L
-#define __cpp_lib_to_underlying 202102L
+#ifdef __cpp_lib_to_underlying // C++ >= 23
/// Convert an object of enumeration type to its underlying type.
template<typename _Tp>
[[nodiscard]]
constexpr underlying_type_t<_Tp>
to_underlying(_Tp __value) noexcept
{ return static_cast<underlying_type_t<_Tp>>(__value); }
+#endif
-#define __cpp_lib_unreachable 202202L
+#ifdef __cpp_lib_unreachable // C++ >= 23
/// Informs the compiler that program control flow never reaches this point.
/**
* Evaluating a call to this function results in undefined behaviour.
__builtin_unreachable();
#endif
}
-#endif // C++23
-#endif // C++20
-#endif // C++17
-#endif // C++14
+#endif
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#pragma GCC system_header
-#if __cplusplus >= 201703L
+#define __glibcxx_want_variant
+#include <bits/version.h>
+#ifdef __cpp_lib_variant // C++ >= 17
#include <initializer_list>
#include <type_traits>
#include <bits/enable_special_members.h>
# include <compare>
#endif
-#if __cpp_concepts >= 202002L && __cpp_constexpr >= 201811L
-// P2231R1 constexpr needs constexpr unions and constrained destructors.
-# define __cpp_lib_variant 202106L
-#else
+// C++ < 20 || __cpp_concepts < 202002L || __cpp_constexpr < 201811L
+#if __cpp_lib_variant < 202106L
# include <ext/aligned_buffer.h> // Use __aligned_membuf instead of union.
-# define __cpp_lib_variant 202102L
#endif
+
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++17
-
+#endif // __cpp_lib_variant
#endif // _GLIBCXX_VARIANT
# include <debug/vector>
#endif
+#define __glibcxx_want_erase_if
+#include <bits/version.h>
+
#if __cplusplus >= 201703L
#include <bits/memory_resource.h>
namespace std _GLIBCXX_VISIBILITY(default)
} // namespace std
#endif // C++17
-#if __cplusplus > 201703L
+#ifdef __cpp_lib_erase_if // C++ >= 20 && HOSTED
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#define __cpp_lib_erase_if 202002L
-
template<typename _Tp, typename _Alloc, typename _Predicate>
_GLIBCXX20_CONSTEXPR
inline typename vector<_Tp, _Alloc>::size_type
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif // C++20
+#endif // __cpp_lib_erase_if
#endif /* _GLIBCXX_VECTOR */
#pragma GCC system_header
+#define __glibcxx_want_three_way_comparison
+#include <bits/version.h>
+
#if __cplusplus > 201703L && __cpp_impl_three_way_comparison >= 201907L
#include <concepts>
-#if __cpp_lib_concepts
-# define __cpp_lib_three_way_comparison 201907L
-#endif
-
namespace std _GLIBCXX_VISIBILITY(default)
{
// [cmp.categories], comparison category types
using common_comparison_category_t
= typename common_comparison_category<_Ts...>::type;
-#if __cpp_lib_concepts
+#if __cpp_lib_three_way_comparison >= 201907L
+ // C++ >= 20 && impl_3way_comparison >= 201907 && lib_concepts
namespace __detail
{
template<typename _Tp, typename _Cat>
= decltype(__detail::__synth3way(std::declval<_Tp&>(),
std::declval<_Up&>()));
} // namespace __detail
-#endif // concepts
+#endif // __cpp_lib_three_way_comparison >= 201907L
} // namespace std
#endif // C++20
#include <bits/c++config.h>
#include <bits/exception.h>
+#define __glibcxx_want_uncaught_exceptions
+#include <bits/version.h>
+
extern "C++" {
namespace std _GLIBCXX_VISIBILITY(default)
_GLIBCXX17_DEPRECATED_SUGGEST("std::uncaught_exceptions()")
bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
-#if __cplusplus >= 201703L || !defined(__STRICT_ANSI__) // c++17 or gnu++98
-#define __cpp_lib_uncaught_exceptions 201411L
+#ifdef __cpp_lib_uncaught_exceptions // C++ >= 17 || GNU++ >= 03
/** The number of uncaught exceptions.
* @since C++17, or any non-strict mode, e.g. `-std=gnu++98`
* @see uncaught_exception()
#include <bits/c++config.h>
#include <bits/exception.h>
+#define __glibcxx_want_launder
+#define __glibcxx_want_hardware_interference_size
+#define __glibcxx_want_destroying_delete
+#include <bits/version.h>
+
#pragma GCC visibility push(default)
extern "C++" {
#if __cplusplus >= 201703L
namespace std
{
-#ifdef _GLIBCXX_HAVE_BUILTIN_LAUNDER
-#define __cpp_lib_launder 201606L
+#ifdef __cpp_lib_launder // C++ >= 17 && HAVE_BUILTIN_LAUNDER
/// Pointer optimization barrier [ptr.launder]
template<typename _Tp>
[[nodiscard]] constexpr _Tp*
void launder(const void*) = delete;
void launder(volatile void*) = delete;
void launder(const volatile void*) = delete;
-#endif // _GLIBCXX_HAVE_BUILTIN_LAUNDER
+#endif // __cpp_lib_launder
-#ifdef __GCC_DESTRUCTIVE_SIZE
-# define __cpp_lib_hardware_interference_size 201703L
+#ifdef __cpp_lib_hardware_interference_size // C++ >= 17 && defined(gcc_dest_sz)
inline constexpr size_t hardware_destructive_interference_size = __GCC_DESTRUCTIVE_SIZE;
inline constexpr size_t hardware_constructive_interference_size = __GCC_CONSTRUCTIVE_SIZE;
-#endif // __GCC_DESTRUCTIVE_SIZE
+#endif // __cpp_lib_hardware_interference_size
}
#endif // C++17
+// Emitted despite the FTM potentially being undefined.
#if __cplusplus > 201703L
namespace std
{
/// Tag variable of type destroying_delete_t.
inline constexpr destroying_delete_t destroying_delete{};
}
-// Only define the feature test macro if the compiler supports the feature:
-#if __cpp_impl_destroying_delete
-# define __cpp_lib_destroying_delete 201806L
-#endif
#endif // C++20
#pragma GCC visibility pop
#include <bits/hash_bytes.h>
#endif
-#pragma GCC visibility push(default)
+#define __glibcxx_want_constexpr_typeinfo
+#include <bits/version.h>
-#if __cplusplus >= 202100L
-# define __cpp_lib_constexpr_typeinfo 202106L
-#endif
+#pragma GCC visibility push(default)
extern "C++" {
int n2 = std::get<1>(std::move(a));
int n3 = std::get<1>(ca);
-// { dg-error "static assertion failed" "" { target *-*-* } 386 }
-// { dg-error "static assertion failed" "" { target *-*-* } 395 }
-// { dg-error "static assertion failed" "" { target *-*-* } 404 }
+// { dg-error "static assertion failed" "" { target *-*-* } 389 }
+// { dg-error "static assertion failed" "" { target *-*-* } 398 }
+// { dg-error "static assertion failed" "" { target *-*-* } 407 }