cMHN
1.2
C++ library for learning MHNs with pRC
Loading...
Searching...
No Matches
pRC
prc
core
functors
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
6
#include <
prc/core/basic/concepts.hpp
>
7
8
namespace
pRC
9
{
10
struct
Subscript
11
{
12
template
<
class
X>
13
requires
requires
{ declval<X>()[declval<Index const>()]; }
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>
21
concept
IsSubscriptable
=
IsInvocable<Subscript, T, Index>
;
22
}
23
#endif
// pRC_CORE_FUNCTORS_SUBSCRIPT_H
pRC::IsInvocable
Definition
concepts.hpp:31
pRC::IsSubscriptable
Definition
subscript.hpp:21
concepts.hpp
pRC
Definition
cholesky.hpp:10
pRC::Index
Size Index
Definition
basics.hpp:32
pRC::Subscript
Definition
subscript.hpp:11
Generated by
1.11.0