예제 #1
0
std::exception_ptr throwExceptionAndCaptureExceptionPtr() {
	std::exception_ptr currentException;
	try {
		const int throwValue = 10;
		std::cout << "throwing           " << throwValue << "..." << std::endl;
		throw some_exception(throwValue);

	} catch (...) {
		 currentException = std::current_exception();
	}

	return currentException;
}
예제 #2
0
void checkMakeExceptionPtr() {
	std::exception_ptr currentException = std::make_exception_ptr(some_exception(20));
	std::cout << "exception_ptr constructed" << std::endl;

	rethrowException(currentException);
}
예제 #3
0
void f()
{
  throw some_exception();
}