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

‍example output:

0x7ffeba03aff0: 42
0x7ffeba03aff4: y3c-stl terminated: undefined behavior detected (ub_out_of_range)
at y3c::wrap<int*>::operator*(): attempted to access index 1, that is outside the bounds of size 1.
Stack trace (most recent call first):
#0 0x0000563b8ac817f4 in main at /home/runner/work/y3c-stl/y3c-stl/build/../examples/ptr-inc.cc:10:31
8: std::cout << p << ": " << *p << std::endl;
9: p++;
10: std::cout << p << ": " << *p << std::endl;
11: }
値型wrap: base_type型のデータと、このデータの生存状態を管理するクラス
Definition wrap.h:26
Definition array.h:8
#include <y3c/wrap>
#include <iostream>
int main() {
p = &a;
std::cout << p << ": " << *p << std::endl;
p++;
std::cout << p << ": " << *p << std::endl;
}
ポインタ型wrap: element_type型のデータへのポインタと、 このポインタ自体の生存状態を管理するクラス
Definition wrap.h:318