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
/// \ingroup type_traits
12
template
<
bool
B,
typename
T,
typename
F>
13
struct
conditional
{
14
using
type = T;
15
};
16
17
template
<
typename
T,
typename
F>
18
struct
conditional
<
false
, T, F> {
19
using
type = F;
20
};
21
22
/// \ingroup type_traits
23
/// \relates conditional
24
template
<
bool
B,
typename
T,
typename
F>
25
using
conditional_t =
typename
conditional
<B, T, F>::type;
26
27
}
// namespace etl
28
29
#
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:13
include
etl
_type_traits
conditional.hpp
Generated on Sat Sep 20 2025 23:50:58 for tetl by
1.9.8