@mia unless your stdlib is compiled with assertions, the operator[] is no different from the array syntactic sugar, because it just gets inlined from the header
e.g. this is the definition from libc++ https://gist.github.com/q66/2f3d394637b72e2b8130d96fc1a1a350 and it's in the header obviously, not in the library, since vector is a template class