tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
unreachable.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2024 Tobias Hienzsch
3
4#ifndef TETL_UTILITY_UNREACHABLE_HPP
5#define TETL_UTILITY_UNREACHABLE_HPP
6
7#include <etl/_config/all.hpp>
8
9namespace etl {
10
11[[noreturn]] inline auto unreachable() -> void
12{
13#if defined(_MSC_VER) and not defined(__clang__)
14 __assume(false);
15#else
16 __builtin_unreachable();
17#endif
18}
19
20} // namespace etl
21
22#endif // TETL_UTILITY_UNREACHABLE_HPP
Definition adjacent_find.hpp:9
auto unreachable() -> void
Definition unreachable.hpp:11