39#pragma GCC system_header
45#define __glibcxx_want_launder
46#define __glibcxx_want_hardware_interference_size
47#define __glibcxx_want_destroying_delete
48#define __glibcxx_want_constexpr_new
51#pragma GCC diagnostic push
52#pragma GCC diagnostic ignored "-Wc++11-extensions"
54#pragma GCC visibility push(default)
66 class bad_alloc :
public exception
69 _GLIBCXX26_CONSTEXPR bad_alloc()
throw() { }
71#if __cplusplus >= 201103L
72 _GLIBCXX26_CONSTEXPR bad_alloc(
const bad_alloc&) =
default;
73 _GLIBCXX26_CONSTEXPR bad_alloc& operator=(
const bad_alloc&) =
default;
76#if __cplusplus >= 202400L
77 constexpr virtual ~bad_alloc()
noexcept {}
79 constexpr virtual const char*
what()
const noexcept
81 return "std::bad_alloc";
86 virtual ~bad_alloc()
throw();
89 virtual const char*
what()
const throw();
93#if __cplusplus >= 201103L
94 class bad_array_new_length :
public bad_alloc
97 _GLIBCXX26_CONSTEXPR bad_array_new_length()
throw() { }
99#if __cplusplus >= 202400L
100 constexpr virtual ~bad_array_new_length() noexcept {}
102 constexpr virtual const char*
what() const noexcept
104 return "std::bad_array_new_length";
109 virtual ~bad_array_new_length() throw();
112 virtual const
char* what() const throw();
118 enum class align_val_t:
size_t {};
123#if __cplusplus >= 201103L
124 explicit nothrow_t() =
default;
128 extern const nothrow_t nothrow;
138#if __cplusplus >= 201103L
155_GLIBCXX_NODISCARD
void*
operator new(std::size_t)
157 __attribute__((__externally_visible__, __malloc__));
158_GLIBCXX_NODISCARD
void*
operator new[](std::size_t)
160 __attribute__((__externally_visible__, __malloc__));
161void operator delete(
void*) _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
162 __attribute__((__externally_visible__));
163void operator delete[](
void*) _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
164 __attribute__((__externally_visible__));
165#if __cpp_sized_deallocation
166void operator delete(
void*, std::size_t)
167 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
168 __attribute__((__externally_visible__));
169void operator delete[](
void*, std::size_t)
170 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
171 __attribute__((__externally_visible__));
173_GLIBCXX_NODISCARD
void*
operator new(std::size_t,
const std::nothrow_t&)
174 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
175 __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
176_GLIBCXX_NODISCARD
void*
operator new[](std::size_t,
const std::nothrow_t&)
177 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
178 __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
179void operator delete(
void*,
const std::nothrow_t&)
180 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
181 __attribute__((__externally_visible__));
182void operator delete[](
void*,
const std::nothrow_t&)
183 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
184 __attribute__((__externally_visible__));
186_GLIBCXX_NODISCARD
void*
operator new(std::size_t, std::align_val_t)
188 __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__));
189_GLIBCXX_NODISCARD
void*
operator new(std::size_t, std::align_val_t,
const std::nothrow_t&)
190 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
191 __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__));
192void operator delete(
void*, std::align_val_t) _GLIBCXX_TXN_SAFE
193 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
194void operator delete(
void*, std::align_val_t,
const std::nothrow_t&)
196 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
197_GLIBCXX_NODISCARD
void*
operator new[](std::size_t, std::align_val_t)
199 __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__));
200_GLIBCXX_NODISCARD
void*
operator new[](std::size_t, std::align_val_t,
const std::nothrow_t&)
201 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
202 __attribute__((__externally_visible__, __alloc_size__ (1), __alloc_align__ (2), __malloc__));
203void operator delete[](
void*, std::align_val_t) _GLIBCXX_TXN_SAFE
204 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
205void operator delete[](
void*, std::align_val_t,
const std::nothrow_t&)
207 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
208#if __cpp_sized_deallocation
209void operator delete(
void*, std::size_t, std::align_val_t) _GLIBCXX_TXN_SAFE
210 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
211void operator delete[](
void*, std::size_t, std::align_val_t) _GLIBCXX_TXN_SAFE
212 _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__));
216#if __cpp_lib_constexpr_new >= 202406L
217# define _GLIBCXX_PLACEMENT_CONSTEXPR constexpr
219# define _GLIBCXX_PLACEMENT_CONSTEXPR inline
223_GLIBCXX_NODISCARD _GLIBCXX_PLACEMENT_CONSTEXPR
224void*
operator new(std::size_t,
void* __p)
225 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
227_GLIBCXX_NODISCARD _GLIBCXX_PLACEMENT_CONSTEXPR
228void*
operator new[](std::size_t,
void* __p)
229 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
232#undef _GLIBCXX_PLACEMENT_CONSTEXPR
235inline void operator delete (
void*,
void*)
236 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
238inline void operator delete[](
void*,
void*)
239 _GLIBCXX_TXN_SAFE _GLIBCXX_USE_NOEXCEPT
246#ifdef __cpp_lib_launder
248 template<typename _Tp>
249 [[nodiscard]]
constexpr _Tp*
250 launder(_Tp* __p)
noexcept
252 if constexpr (__is_same(
const volatile _Tp,
const volatile void))
253 static_assert(!__is_same(
const volatile _Tp,
const volatile void),
254 "std::launder argument must not be a void pointer");
255#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
256 else if constexpr (__is_function(_Tp))
257 static_assert(!__is_function(_Tp),
258 "std::launder argument must not be a function pointer");
261 return __builtin_launder(__p);
266#ifdef __cpp_lib_hardware_interference_size
267 inline constexpr size_t hardware_destructive_interference_size = __GCC_DESTRUCTIVE_SIZE;
268 inline constexpr size_t hardware_constructive_interference_size = __GCC_CONSTRUCTIVE_SIZE;
272#if __cplusplus >= 202002L
275 struct destroying_delete_t
277 explicit destroying_delete_t() =
default;
284#pragma GCC visibility pop
285#pragma GCC diagnostic pop
ISO C++ entities toplevel namespace is std.
new_handler set_new_handler(new_handler)
Takes a replacement handler as the argument, returns the previous handler.
new_handler get_new_handler() noexcept
Return the current new handler.
constexpr destroying_delete_t destroying_delete
Tag variable of type destroying_delete_t.
Exception possibly thrown by new.
virtual const char * what() const
Tag type used to declare a class-specific operator delete that can invoke the destructor before deall...