cMHN 1.1
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, If<IsDefined<Identity<T>>> = 0,
11 If<IsConstructible<Identity<T>>> = 0>
12 static inline constexpr auto identity()
13 {
14 return Identity<T>()();
15 }
16
17 static inline constexpr auto identity()
18 {
19 return Identity<Void<>>();
20 }
21
22 template<class T, class X, If<IsDefined<Identity<T>>> = 0,
23 If<IsConstructible<Identity<T>>> = 0,
24 If<IsInvocable<Identity<T>, X>> = 0>
25 static inline constexpr auto identity(X &&value)
26 {
27 return Identity<T>()(forward<X>(value));
28 }
29}
30#endif // pRC_CORE_BASIC_FUNCTIONS_IDENTITY_H
Definition cholesky.hpp:18
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
static constexpr auto identity()
Definition identity.hpp:12
Definition type_traits.hpp:262