void* operator new(size_t size); // (1)
template<class... Args>
void* operator new(size_t size, const Args&... args); // (2)
template<class This, class Alloc, class... Args>
void* operator new(size_t size, const This&, allocator_arg_t, Alloc alloc, Args&&...); // (3)
概要
task::promise_typeクラスのnew演算子オーバーロード。
U型をサイズおよびアライメントが__STDCPP_DEFAULT_NEW_ALIGNMENT__である未規定の型としたとき、説明用のPAllocをallocator_traits<Alloc>::template rebind_alloc<U>とする。
適格要件
allocator_traits<PAlloc>::pointerがポインタ型である。
効果
-
(1) : 下記と等価
return operator new(size, allocator_arg, allocator_type()); -
(2), (3) :
PAlloc型のアロケータpallocをallocで初期化する。- サイズ
sizeのコルーチンステートに十分なストレージとなるUの最小配列ストレージ、およびoperator deleteが後でpallocと等しいアロケータでこのメモリブロックを解放するのに必要となる未規定の追加ストレージの確保にpallocを用いる。
戻り値
確保したストレージへのポインタ
バージョン
言語
- C++26
処理系
- Clang: ??
- GCC: ??
- ICC: ??
- Visual C++: ??