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

A variant was read with the wrong alternative, or while valueless. More...

#include <StormByte/safe/exception.hxx>

Inheritance diagram for StormByte::Safe::BadVariantAccess:
Collaboration diagram for StormByte::Safe::BadVariantAccess:

Public Member Functions

 BadVariantAccess (std::string_view message)
 Copy a body into StormByte.Safe: message.
template<typename... Args>
requires (sizeof...(Args) >= 1)
 BadVariantAccess (std::string_view pattern, Args &&... args)
 Replace literal {} in pattern.
 BadVariantAccess (const BadVariantAccess &other)
 Copy constructor.
 BadVariantAccess (BadVariantAccess &&other) noexcept
 Move constructor.
 ~BadVariantAccess () noexcept override
 Destructor.
BadVariantAccess & operator= (const BadVariantAccess &other)
 Copy assignment.
BadVariantAccess & operator= (BadVariantAccess &&other) noexcept
 Move assignment.
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.
virtual const char * what () const noexcept
 Message pointer.

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

A variant was read with the wrong alternative, or while valueless.

The message is the body only. The path Safe is applied by Exception.

Constructor & Destructor Documentation

◆ BadVariantAccess() [1/4]

StormByte::Safe::BadVariantAccess::BadVariantAccess ( std::string_view message)
explicit

Copy a body into StormByte.Safe: message.

Parameters
messageBody. Not a path and not a format string.

◆ BadVariantAccess() [2/4]

template<typename... Args>
requires (sizeof...(Args) >= 1)
StormByte::Safe::BadVariantAccess::BadVariantAccess ( std::string_view pattern,
Args &&... args )
inline

Replace literal {} in pattern.

Template Parameters
ArgsViews, numbers, or types that convert to std::string. A number uses std::to_string.
Parameters
patternBody with literal {} tokens.
argsReplacements. One per token, in order.

◆ BadVariantAccess() [3/4]

StormByte::Safe::BadVariantAccess::BadVariantAccess ( const BadVariantAccess & other)

Copy constructor.

Defined in the Base DLL.

Parameters
otherException to copy.

◆ BadVariantAccess() [4/4]

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

Move constructor.

Defined in the Base DLL.

Parameters
otherException to take.

◆ ~BadVariantAccess()

StormByte::Safe::BadVariantAccess::~BadVariantAccess ( )
overridenoexcept

Destructor.

Defined in the Base DLL so catch matches across modules.

Member Function Documentation

◆ operator=() [1/2]

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

Move assignment.

Defined in the Base DLL.

Parameters
otherException to take.
Returns
This exception.

◆ operator=() [2/2]

BadVariantAccess & StormByte::Safe::BadVariantAccess::operator= ( const BadVariantAccess & other)

Copy assignment.

Defined in the Base DLL.

Parameters
otherException to copy.
Returns
This exception.

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