cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
where.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_BASIC_FUNCTIONS_WHERE_H
4#define pRC_CORE_BASIC_FUNCTIONS_WHERE_H
5
7
8namespace pRC
9{
10 template<IsBool TE, class XA, class XB>
11 static inline constexpr decltype(auto) where(TE const e, XA &&a, XB &&b)
12 {
14 {
15 return as(e ? forward<XA>(a) : forward<XB>(b));
16 }
17 else
18 {
19 using T =
21 return where(e, T(forward<XA>(a)), T(forward<XB>(b)));
22 }
23 }
24}
25#endif // pRC_CORE_BASIC_FUNCTIONS_WHERE_H
Definition value.hpp:12
Definition concepts.hpp:28
pRC::Float<> T
Definition externs_nonTT.hpp:1
Definition cholesky.hpp:10
static constexpr decltype(auto) where(TE const e, XA &&a, XB &&b)
Definition where.hpp:11
std::common_type_t< Ts... > Common
Definition basics.hpp:53
RemoveConst< RemoveReference< T > > RemoveConstReference
Definition basics.hpp:47
static constexpr RemoveConst< X > as(X &&a)
Definition basics.hpp:83