-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Learning Boost C++
By :
C++11 introduced the ability to capture and store an exception that can be passed around and rethrown later. This is particularly useful for propagating exceptions across threads.
To store an exception, the type std::exception_ptr is used. std::exception_ptr is a smart pointer type with shared ownership semantics, not unlike std::shared_ptr (see Chapter 3, Memory Management and Exception Safety). An instance of std::exception_ptr is copyable and movable and can be passed to other functions potentially across threads. A default-constructed std::exception_ptr is a null object that does not point to any exception. Copying a std::exception_ptr object creates two instances that manage the same underlying exception object. The underlying exception object continues to exist as long as the last exception_ptr instance containing it exists.
The function std::current_exception, when called inside a catch-block, returns the active...
Change the font size
Change margin width
Change background colour