Backport
bpstd::bad_variant_access Class Reference

Exception thrown by variant. More...

#include <variant.hpp>

+ Inheritance diagram for bpstd::bad_variant_access:
+ Collaboration diagram for bpstd::bad_variant_access:

Public Member Functions

 bad_variant_access () noexcept=default
 Constructs a new instance of bad_variant_access.
 
const char * what () const noexcept override
 returns an explanatory string of the exception More...
 

Detailed Description

Exception thrown by variant.

bad_variant_access is the type of the exception thrown in the following situations:

  • get(std::variant) called with an index or type that does not match the currently active alternative
  • visit called to visit a variant that is valueless_by_exception

Definition at line 179 of file variant.hpp.

Member Function Documentation

◆ what()

const char * bpstd::bad_variant_access::what ( ) const
inlineoverridenoexcept

returns an explanatory string of the exception

Returns
string explaining the issue

Definition at line 1078 of file variant.hpp.


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