pRC
multi-purpose Tensor Train library for C++
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, If<IsDefined<Unit<T>>> = 0,
11 If<IsConstructible<Unit<T>>> = 0, If<IsInvocable<Unit<T>>> = 0>
12 static inline constexpr auto unit()
13 {
14 return Unit<T>()();
15 }
16
17 static inline constexpr auto unit()
18 {
19 return Unit<Void<>>();
20 }
21
22 template<class T, class X, If<IsDefined<Unit<T>>> = 0,
23 If<IsConstructible<Unit<T>>> = 0, If<IsInvocable<Unit<T>, X>> = 0>
24 static inline constexpr auto unit(X &&value)
25 {
26 return Unit<T>()(forward<X>(value));
27 }
28}
29#endif // pRC_CORE_BASIC_FUNCTIONS_UNIT_H
Definition cholesky.hpp:18
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
static constexpr auto unit()
Definition unit.hpp:12
Definition type_traits.hpp:265