An immutable refcounted string suitable for use in an exception.

Synopsis

Declared in <folly/lang/Exception.h>

class exception_shared_string;

Description

An immutable refcounted string, with the same layout as a pointer, suitable for use in an exception. Exceptions are intended to cheaply nothrow‐copy‐ constructible and mostly do not need to optimize moves, and this affects how exception messages are best stored.

May be constructed with a string literal pointer, which will be stored with no refcount required.

Member Functions

Name

Description

exception_shared_string [constructor]

Constructors

~exception_shared_string [destructor]

Destructor, releasing the refcounted string when not a literal.

operator=

Assignment operators

what

Returns the stored null‐terminated string.

Created with MrDocs