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
7
namespace
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.
11
template
<
bool
B,
typename
T,
typename
F>
12
struct
conditional
{
13
using
type = T;
14
};
15
16
template
<
typename
T,
typename
F>
17
struct
conditional
<
false
, T, F> {
18
using
type = F;
19
};
20
21
template
<
bool
B,
typename
T,
typename
F>
22
using
conditional_t =
typename
conditional
<B, T, F>::type;
23
24
}
// namespace etl
25
26
#
endif
// TETL_TYPE_TRAITS_CONDITIONAL_HPP
etl
Definition
adjacent_find.hpp:9
etl::conditional
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
include
etl
_type_traits
conditional.hpp
Generated on Sun Sep 7 2025 19:15:17 for tetl by
1.9.8