tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
exception.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2019 Tobias Hienzsch
3
4#ifndef TETL_EXCEPTION_EXCEPTION_HPP
5#define TETL_EXCEPTION_EXCEPTION_HPP
6
7namespace etl {
8
9struct exception {
10 constexpr exception() = default;
11
12 constexpr explicit exception(char const* what)
13 : _what{what}
14 {
15 }
16
17 [[nodiscard]] constexpr auto what() const noexcept -> char const*
18 {
19 return _what;
20 }
21
22private:
23 char const* _what{nullptr};
24};
25
26} // namespace etl
27
28#endif // TETL_EXCEPTION_EXCEPTION_HPP
Definition adjacent_find.hpp:9
Definition exception.hpp:9
constexpr exception()=default
constexpr auto what() const noexcept -> char const *
Definition exception.hpp:17
constexpr exception(char const *what)
Definition exception.hpp:12