tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
conditional.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_TYPE_TRAITS_CONDITIONAL_HPP
5#define TETL_TYPE_TRAITS_CONDITIONAL_HPP
6
7namespace etl {
8
9/// \brief Provides member typedef type, which is defined as T if B is true at
10/// compile time, or as F if B is false.
11template <bool B, typename T, typename F>
13 using type = T;
14};
15
16template <typename T, typename F>
17struct conditional<false, T, F> {
18 using type = F;
19};
20
21template <bool B, typename T, typename F>
22using conditional_t = typename conditional<B, T, F>::type;
23
24} // namespace etl
25
26#endif // TETL_TYPE_TRAITS_CONDITIONAL_HPP
Definition adjacent_find.hpp:9
Provides member typedef type, which is defined as T if B is true at compile time, or as F if B is fal...
Definition conditional.hpp:12