StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Safe::BadOptionalAccess Class Reference

An empty Optional was dereferenced. More...

#include <StormByte/safe/exception.hxx>

Inheritance diagram for StormByte::Safe::BadOptionalAccess:
Collaboration diagram for StormByte::Safe::BadOptionalAccess:

Public Member Functions

 BadOptionalAccess () noexcept
 Construct an empty-optional failure.
 BadOptionalAccess (const BadOptionalAccess &other) noexcept
 Copy constructor.
 BadOptionalAccess (BadOptionalAccess &&other) noexcept
 Move constructor.
 ~BadOptionalAccess () noexcept override
 Destructor.
BadOptionalAccess & operator= (const BadOptionalAccess &other) noexcept
 Copy assignment.
BadOptionalAccess & operator= (BadOptionalAccess &&other) noexcept
 Move assignment.
const char * what () const noexcept override
 Return the static message.
Public Member Functions inherited from StormByte::Safe::Exception
 Exception (std::string_view message)
 Copy a body into StormByte.Safe: message.
 Exception (const Exception &other)
 Copy constructor.
 Exception (Exception &&other) noexcept
 Move constructor.
 ~Exception () noexcept override
 Destructor.
Exception & operator= (const Exception &other)
 Copy assignment.
Exception & operator= (Exception &&other) noexcept
 Move assignment.
template<typename... Args>
requires (sizeof...(Args) >= 1)
 Exception (std::string_view pattern, Args &&... args)
 Replace literal {} under the Safe path.
Public Member Functions inherited from StormByte::Exception
 Exception (std::string_view message)
 Copies text into StormByte: message.
 Exception (const Exception &other)
 Copy constructor.
 Exception (Exception &&other) noexcept
 Move constructor.
Exception & operator= (const Exception &other)
 Copy assignment.
Exception & operator= (Exception &&other) noexcept
 Move assignment.

Additional Inherited Members

Protected Member Functions inherited from StormByte::Safe::Exception
 Exception () noexcept
 Construct without allocating message storage.
Protected Member Functions inherited from StormByte::Exception
 Exception () noexcept
 Construct without allocating message storage.
 Exception (Path path, std::string_view message)
 Stores StormByte.path: message, or StormByte: message when path is empty.
 Exception (Path path, Safe::String &&message)
 Stores StormByte.path: message, taking the body.
template<typename... Args>
requires (sizeof...(Args) >= 1)
 Exception (Path path, std::string_view pattern, Args &&... args)
 Stores StormByte.path: message after replacing literal {}.

Detailed Description

An empty Optional was dereferenced.

Constructing this exception does not allocate. what() returns static text. The path is part of that literal because this leaf does not fill the owned message.

Constructor & Destructor Documentation

◆ BadOptionalAccess() [1/3]

StormByte::Safe::BadOptionalAccess::BadOptionalAccess ( )
noexcept

Construct an empty-optional failure.

No message storage.

◆ BadOptionalAccess() [2/3]

StormByte::Safe::BadOptionalAccess::BadOptionalAccess ( const BadOptionalAccess & other)
noexcept

Copy constructor.

Defined in the Base DLL.

Parameters
otherException to copy.

◆ BadOptionalAccess() [3/3]

StormByte::Safe::BadOptionalAccess::BadOptionalAccess ( BadOptionalAccess && other)
noexcept

Move constructor.

Defined in the Base DLL.

Parameters
otherException to take.

◆ ~BadOptionalAccess()

StormByte::Safe::BadOptionalAccess::~BadOptionalAccess ( )
overridenoexcept

Destructor.

Defined in the Base DLL so catch matches across modules.

Member Function Documentation

◆ operator=() [1/2]

BadOptionalAccess & StormByte::Safe::BadOptionalAccess::operator= ( BadOptionalAccess && other)
noexcept

Move assignment.

Defined in the Base DLL.

Parameters
otherException to take.
Returns
This exception.

◆ operator=() [2/2]

BadOptionalAccess & StormByte::Safe::BadOptionalAccess::operator= ( const BadOptionalAccess & other)
noexcept

Copy assignment.

Defined in the Base DLL.

Parameters
otherException to copy.
Returns
This exception.

◆ what()

const char * StormByte::Safe::BadOptionalAccess::what ( ) const
overridevirtualnoexcept

Return the static message.

Returns
StormByte.Safe: Optional has no value.

Reimplemented from StormByte::Exception.


The documentation for this class was generated from the following file: