tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
bad_variant_access.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4#ifndef TETL_VARIANT_BAD_VARIANT_ACCESS_HPP
5#define TETL_VARIANT_BAD_VARIANT_ACCESS_HPP
6
7#include <etl/_exception/exception.hpp>
8
9namespace etl {
10
11/// \brief etl::bad_variant_access is the type of the exception thrown in the
12/// following situations: (1) etl::get(etl::variant) called with an index or
13/// type that does not match the currently active alternative. (2) etl::visit
14/// called to visit a variant that is valueless_by_exception
16 constexpr bad_variant_access() = default;
17
18 constexpr explicit bad_variant_access(char const* what)
19 : exception{what}
20 {
21 }
22};
23
24} // namespace etl
25
26#endif // TETL_VARIANT_BAD_VARIANT_ACCESS_HPP
Definition adjacent_find.hpp:9
etl::bad_variant_access is the type of the exception thrown in the following situations: (1) etl::get...
Definition bad_variant_access.hpp:15
constexpr bad_variant_access(char const *what)
Definition bad_variant_access.hpp:18
constexpr bad_variant_access()=default
Definition exception.hpp:9
constexpr exception(char const *what)
Definition exception.hpp:12