cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
add.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_FUNCTORS_ADD_H
4#define pRC_CORE_FUNCTORS_ADD_H
5
8
9namespace pRC
10{
11 struct Add
12 {
13 template<class T>
14 requires requires { zero<T>(); }
15 static constexpr auto Identity()
16 {
17 return zero<T>();
18 }
19
20 template<class XA, class XB>
21 requires requires { declval<XA>() + declval<XB>(); }
22 constexpr decltype(auto) operator()(XA &&a, XB &&b) const
23 {
24 return forward<XA>(a) + forward<XB>(b);
25 }
26 };
27}
28#endif // pRC_CORE_FUNCTORS_ADD_H
Definition cholesky.hpp:10
static constexpr auto zero()
Definition zero.hpp:12
Definition add.hpp:12
static constexpr auto Identity()
Definition add.hpp:15