最終更新日時(UTC):
が更新

履歴 編集

function template
<execution>

std::execution::task::promise_type::operator new(C++26)

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__である未規定の型としたとき、説明用のPAllocallocator_traits<Alloc>::template rebind_alloc<U>とする。

適格要件

allocator_traits<PAlloc>::pointerがポインタ型である。

効果

  • (1) : 下記と等価

    return operator new(size, allocator_arg, allocator_type());
    

  • (2), (3) :

    • PAlloc型のアロケータpallocallocで初期化する。
    • サイズsizeのコルーチンステートに十分なストレージとなるUの最小配列ストレージ、およびoperator deleteが後でpallocと等しいアロケータでこのメモリブロックを解放するのに必要となる未規定の追加ストレージの確保にpallocを用いる。

戻り値

確保したストレージへのポインタ

バージョン

言語

  • C++26

処理系

関連項目

参照