[libcxx-dev] exception_ptr reference counting

Shoaib Meenai via libcxx-dev libcxx-dev at lists.llvm.org
Mon Nov 18 18:34:41 PST 2019


According to cppreference [1]:

> The exception object referenced by an std::exception_ptr remains valid as long as there remains at least one std::exception_ptr that is referencing it: std::exception_ptr is a shared-ownership smart pointer

I don’t actually see any code in libc++’s implementation to prolong the lifetime of an exception object in case there are exception_ptrs pointing to it. I feel like I’m missing something obvious; how is this case handled?

[1] https://en.cppreference.com/w/cpp/error/exception_ptr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20191119/4a0b1a17/attachment.html>


More information about the libcxx-dev mailing list