concepts: add "supports_indexing"
This commit is contained in:
parent
6b53abd6b4
commit
c528e28a0e
@ -288,6 +288,13 @@ namespace cruft::concepts {
|
||||
};
|
||||
|
||||
|
||||
template <
|
||||
typename ContainerT,
|
||||
typename IndexT = std::size_t
|
||||
>
|
||||
concept supports_indexing = requires (ContainerT &t, IndexT idx) {
|
||||
{ t[idx] };
|
||||
};
|
||||
|
||||
|
||||
/// A type that supports arithmetic operators.
|
||||
|
Loading…
x
Reference in New Issue
Block a user