cMHN 1.1
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
zero.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_BASIC_ZERO_H
4#define pRC_CORE_BASIC_ZERO_H
5
7
8namespace pRC
9{
10 template<class T>
11 struct Zero<T, If<IsBool<T>>>
12 {
13 constexpr T operator()()
14 {
15 return false;
16 }
17 };
18
19 template<class T>
20 struct Zero<T, If<IsIntegral<T>>>
21 {
22 constexpr T operator()()
23 {
24 return 0;
25 }
26 };
27
28 template<>
29 struct Zero<Void<>>
30 {
31 template<class T, If<Any<IsBool<T>, IsIntegral<T>>> = 0>
32 constexpr operator T() const
33 {
34 return Zero<T>()();
35 }
36 };
37}
38#endif // pRC_CORE_BASIC_ZERO_H
pRC::Float<> T
Definition externs_nonTT.hpp:1
Definition cholesky.hpp:18
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
std::enable_if_t< B{}, int > If
Definition type_traits.hpp:68
void Void
Definition type_traits.hpp:16
All< std::is_integral< T >, Not< IsBool< T > > > IsIntegral
Definition type_traits.hpp:180
Definition type_traits.hpp:99
constexpr T operator()()
Definition zero.hpp:13
constexpr T operator()()
Definition zero.hpp:22
Definition type_traits.hpp:268