tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
bad_optional_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_OPTIONAL_BAD_OPTIONAL_ACCESS_HPP
5#define TETL_OPTIONAL_BAD_OPTIONAL_ACCESS_HPP
6
7#include <etl/_exception/exception.hpp>
8
9namespace etl {
10
11/// \brief Defines a type of object to be thrown by etl::optional::value when
12/// accessing an optional object that does not contain a value.
13///
14/// https://en.cppreference.com/w/cpp/utility/optional/bad_optional_access
15///
16/// \ingroup optional
18 constexpr bad_optional_access() = default;
19
20 constexpr explicit bad_optional_access(char const* what)
21 : exception{what}
22 {
23 }
24};
25
26} // namespace etl
27
28#endif // TETL_OPTIONAL_BAD_OPTIONAL_ACCESS_HPP
Definition adjacent_find.hpp:9
Defines a type of object to be thrown by etl::optional::value when accessing an optional object that ...
Definition bad_optional_access.hpp:17
constexpr bad_optional_access(char const *what)
Definition bad_optional_access.hpp:20
constexpr bad_optional_access()=default
Definition exception.hpp:9
constexpr exception(char const *what)
Definition exception.hpp:12