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