Namespaces
Variants
Views
Actions

std::make_exception_ptr

From cppreference.com
 
 
 
Error handling
Exception handling
exception
uncaught_exception
exception_ptr(C++11)
make_exception_ptr(C++11)
current_exception(C++11)
rethrow_exception(C++11)
nested_exception(C++11)
throw_with_nested(C++11)
rethrow_if_nested(C++11)
Exception handling failures
terminate
terminate_handler
get_terminate(C++11)
set_terminate
unexpected(deprecated)
bad_exception
unexpected_handler(deprecated)
get_unexpected(C++11)(deprecated)
set_unexpected(deprecated)
Exception categories
logic_error
invalid_argument
domain_error
length_error
out_of_range
runtime_error
range_error
overflow_error
underflow_error
Error codes
Error codes
errno
Assertions
assert
system_error facility
error_category(C++11)
generic_category(C++11)
system_category(C++11)
error_condition(C++11)
errc(C++11)
error_code(C++11)
system_error(C++11)
 
Defined in header <exception>
template< class E >
std::exception_ptr make_exception_ptr( E e )
(since C++11)

Creates an std::exception_ptr that holds a reference to a copy of e, as if by executing

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

Contents

[edit] Parameters

(none)

[edit] Return value

An instance of std::exception_ptr holding a reference to the copy of e, or to an instance of std::bad_alloc or to an instance of std::bad_exception (see std::current_exception).

[edit] Exceptions

noexcept specification:  
noexcept
  (since C++11)

[edit] See also

captures the current exception in a std::exception_ptr
(function) [edit]