folly::exception_ptr_use_count

Returns the reference count of the stored exception.

Synopsis

Declared in <folly/lang/Exception.h>

std::size_t
exception_ptr_use_count(std::exception_ptr const& ptr) noexcept;

Description

Returns 0 for an empty exception_ptr. Otherwise, returns the number of exception_ptr instances that refer to the same stored exception object.

Analogous to std::shared_ptr::use_count.

Return Value

The number of exception_ptr instances sharing the stored exception.

Parameters

NameDescription
ptrThe exception_ptr whose stored exception is inspected.