cMHN 1.2
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 = Void>
11 struct Zero;
12
13 template<class T>
14 struct Zero<T const> : Zero<T>
15 {
16 };
17
18 template<IsVoid T>
19 struct Zero<T>
20 {
21 template<class F>
22 requires IsBool<F> || IsIntegral<F>
23 constexpr operator F() const
24 {
25 return Zero<F>()();
26 }
27 };
28
29 template<IsBool T>
30 struct Zero<T>
31 {
32 constexpr T operator()() const
33 {
34 return false;
35 }
36 };
37
38 template<IsIntegral T>
39 struct Zero<T>
40 {
41 constexpr T operator()() const
42 {
43 return 0;
44 }
45 };
46}
47#endif // pRC_CORE_BASIC_ZERO_H
Definition value.hpp:12
Definition concepts.hpp:58
Definition concepts.hpp:70
Definition cholesky.hpp:10
constexpr T operator()() const
Definition zero.hpp:32
Definition zero.hpp:11