pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
subscript.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_FUNCTORS_SUBSCRIPT_H
4#define pRC_CORE_FUNCTORS_SUBSCRIPT_H
5
7
8namespace pRC
9{
10 struct Subscript
11 {
12 template<class X,
14 constexpr decltype(auto) operator()(X &&a, Index const index) const
15 {
16 return forward<X>(a)[index];
17 }
18 };
19
20 template<class T>
22}
23#endif // pRC_CORE_FUNCTORS_SUBSCRIPT_H
Definition cholesky.hpp:18
std::is_invocable< F, Args... > IsInvocable
Definition type_traits.hpp:134
IsInvocable< Subscript, T, Index > IsSubscriptable
Definition subscript.hpp:21
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13
Size Index
Definition type_traits.hpp:21
Definition subscript.hpp:11
constexpr decltype(auto) operator()(X &&a, Index const index) const
Definition subscript.hpp:14