y3c-stl 0.4.0
Friendly C++ STL wrapper with automatic stacktrace
Loading...
Searching...
No Matches
array-operator.cc

‍example output:

y3c-stl terminated: undefined behavior detected (ub_out_of_range)
at y3c::array<int, 5>::operator[](): attempted to access index 100, that is outside the bounds of size 5.
Stack trace (most recent call first):
#0 0x0000000000004618 in main at /home/runner/work/y3c-stl/y3c-stl/build/../examples/array-operator.cc:5:14
3: int main() {
5: a[100] = 42;
6: }
#1 0x0000000000029d8f at /lib/x86_64-linux-gnu/libc.so.6
#2 0x0000000000029e3f in __libc_start_main at /lib/x86_64-linux-gnu/libc.so.6
#3 0x0000000000004504 in _start at /home/runner/work/y3c-stl/y3c-stl/build/examples/y3c-example-array-operator
固定長配列 (std::array)
Definition array.h:20
reference operator[](size_type n)
要素アクセス
Definition array.h:160
Definition array.h:8
#include <y3c/array>
int main() {
a[100] = 42;
}