Namespaces
Variants

std:: make_exception_ptr

From cppreference.net
헤더에 정의됨 <exception>
template < class E >
std:: exception_ptr make_exception_ptr ( E e ) noexcept ;
(C++11부터)
(C++26부터 constexpr)

std::exception_ptr 에 대한 참조를 보유하는 복사본을 생성합니다. 이는 다음과 같은 코드를 실행하는 것과 같습니다:

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

목차

매개변수

e - 예외 객체의 복사본에 대한 참조를 생성하기 위한

반환값

std::exception_ptr 인스턴스는 e 의 복사본에 대한 참조를 보유하거나, std::bad_alloc 인스턴스 또는 std::bad_exception 인스턴스를 보유합니다( std::current_exception 참조).

참고 사항

매개변수가 값으로 전달되며 슬라이싱이 발생할 수 있습니다.

기능 테스트 매크로 표준 기능
__cpp_lib_constexpr_exceptions 202411L (C++26) constexpr 예외 타입

예제

참고 항목

현재 예외를 std::exception_ptr 에 캡처합니다
(함수)