StormByte 2.0.0
C++26 foundation of the StormByte suite
 
Loading...
Searching...
No Matches
StormByte::Type::HasSubscript Concept Reference

StormByte::Type::Container that supports operator[] with key/index U. More...

#include <StormByte/type_traits/containers.hxx>

Concept definition

template<typename C, typename U>
concept StormByte::Type::HasSubscript = Container<C> && requires(C& c, U const& u) {
{ c[u] };
}
Has begin(), end() and value_type, and is not a StormByte::Type::String.
Definition containers.hxx:167
StormByte::Type::Container that supports operator[] with key/index U.
Definition containers.hxx:346

Detailed Description

StormByte::Type::Container that supports operator[] with key/index U.

Template Parameters
CContainer type as written (no cv/ref strip — historical).
UKey or index type passed to operator[].

U is the caller's index or key (std::size_t, int, StormByte::Size, …).

static_assert(Type::HasSubscript<std::vector<int>, std::size_t>);