cMHN 1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
unit.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_BASIC_FUNCTIONS_UNIT_H
4#define pRC_CORE_BASIC_FUNCTIONS_UNIT_H
5
7
8namespace pRC
9{
10 template<class T>
11 requires IsDefined<Unit<T>> && IsConstructible<Unit<T>> &&
12 IsInvocable<Unit<T>>
13 static inline constexpr auto unit()
14 {
15 return Unit<T>()();
16 }
17
18 static inline constexpr auto unit()
19 {
20 return Unit<>();
21 }
22
23 template<class T, class X>
24 requires IsDefined<Unit<T>> && IsConstructible<Unit<T>> &&
25 IsInvocable<Unit<T>, X>
26 static inline constexpr auto unit(X &&value)
27 {
28 return Unit<T>()(forward<X>(value));
29 }
30}
31#endif // pRC_CORE_BASIC_FUNCTIONS_UNIT_H
int value
Definition gmock-actions_test.cc:1714
Definition cholesky.hpp:10
static constexpr auto unit()
Definition unit.hpp:13
Definition unit.hpp:11