Struct BadOptionalAccess#
Defined in File Optional.h
Inheritance Relationships#
Base Type#
public std::exception
Struct Documentation#
-
struct BadOptionalAccess : public std::exception#
Defines a type of object to be thrown by TRAP::Optional::Value() when accessing an optional object that does not contain a value.
Public Functions
-
BadOptionalAccess() noexcept = default#
Constructs a new BadOptionalAccess object with an implementation-defined null-terminated byte string which is accessible through what().
Default constructor.
-
constexpr BadOptionalAccess(const BadOptionalAccess &other) noexcept = default#
Constructs a new BadOptionalAccess object with an implementation-defined null-terminated byte string which is accessible through what().
Copy constructor. If *this and other both have dynamic type TRAP::BadOptionalAccess then std::strcmp(what(), other.what()) == 0.
- Parameters:
other – Another exception object to copy.
-
BadOptionalAccess &operator=(const BadOptionalAccess &other) noexcept = default#
Assigns the contents with those of other. If *this and other both have dynamic type TRAP::BadOptionalAccess then std::strcmp(what(), other.what()) == 0 after assignment.
- Parameters:
other – Another exception object to assign with.
- Returns:
*this.
-
inline constexpr const char *what() const noexcept override#
Returns the explanatory string.
- Returns:
Pointer to a null-terminated string with explanatory information. The string is suitable for conversion and display as a std::wstring. The pointer is guaranteed to be valid at least until the exception object from which it is obtained is destroyed, or until a non-const member function (e.g. copy assignment operator) on the exception object is called.
-
BadOptionalAccess() noexcept = default#