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

‍example output:

y3c-stl terminated: exception of type y3c::out_of_range thrown
at y3c::vector<int>::at(): attempted to access index 100, that is outside the bounds of size 5.
Stack trace (most recent call first):
#0 0x0000000000004710 in main at /home/runner/work/y3c-stl/y3c-stl/build/../examples/vector-at.cc:5:9
3: int main() {
4: y3c::vector<int> a = {1, 2, 3, 4, 5};
5: a.at(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 0x00000000000045c4 in _start at /home/runner/work/y3c-stl/y3c-stl/build/examples/y3c-example-vector-at
Definition terminate.h:179
可変長配列 (std::vector)
Definition vector.h:23
reference at(size_type n, internal::skip_trace_tag={})
要素アクセス
Definition vector.h:537
Definition array.h:8
#include <y3c/vector>
int main() {
y3c::vector<int> a = {1, 2, 3, 4, 5};
a.at(100) = 42;
}