◐ Shell
clean mode source ↗

std::make_exception_ptr - cppreference.com

提供: cppreference.com

<tbody> </tbody>

template< class E > std::exception_ptr make_exception_ptr( E e ) noexcept;

(C++11以上)

e のコピーへの参照を保持する std::exception_ptr を作成します。 これは以下のコードが実行されたかのように行われます。

try {
    throw e;
} catch(...) {
    return std::current_exception();
}

引数

(なし)

戻り値

e のコピーまたは std::bad_alloc のインスタンスまたは std::bad_exception のインスタンス (std::current_exception を参照してください) への参照を保持する std::exception_ptr のインスタンス。

ノート

この引数は値渡しされ、スライシングの対象です。

関連項目