y3c-stl 0.3.3
Friendly C++ STL wrapper with automatic stacktrace
Loading...
Searching...
No Matches
wrap_array-range.cc

‍example output:

y3c-stl terminated: undefined behavior detected (ub_out_of_range)
at y3c::wrap<int [5]>::operator[](): attempted to access index 100, that is outside the bounds of size 5.
Stack trace (most recent call first):
#0 0x000055f30615460f in main at /home/runner/work/y3c-stl/y3c-stl/build/../examples/wrap_array-range.cc:5:14
3: int main() {
5: a[100] = 42;
6: }
値型wrap: base_type型のデータと、このデータの生存状態を管理するクラス
Definition wrap.h:26
wrap< E & > operator[](std::ptrdiff_t i)
base_typeが E[N] の形の場合、要素への参照を返す
Definition wrap.h:110
Definition array.h:8
#include <y3c/wrap>
int main() {
a[100] = 42;
}