concepts: add "supports_indexing"

This commit is contained in:
Danny Robson 2020-03-16 14:12:04 +11:00
parent 6b53abd6b4
commit c528e28a0e

View File

@ -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.