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

‍example output:

y3c-stl terminated: undefined behavior detected (ub_wrong_iter)
at y3c::vector<int>::insert(): this iterator does not point inside this container.
Stack trace (most recent call first):
#0 0x0000000000004760 in main at /home/runner/work/y3c-stl/y3c-stl/build/../examples/vector-insert.cc:6:13
4: y3c::vector<int> a = {1, 2, 3, 4, 5};
5: y3c::vector<int> b = {1, 2, 3, 4, 5};
6: a.insert(b.begin(), 10);
7: }
#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 0x0000000000004584 in _start at /home/runner/work/y3c-stl/y3c-stl/build/examples/y3c-example-vector-insert
可変長配列 (std::vector)
Definition vector.h:23
iterator insert(const_iterator pos, const T &value, internal::skip_trace_tag={})
要素の挿入
Definition vector.h:375
iterator begin()
先頭要素を指すイテレータを取得
Definition vector.h:673
Definition array.h:8
#include <y3c/vector>
int main() {
y3c::vector<int> a = {1, 2, 3, 4, 5};
y3c::vector<int> b = {1, 2, 3, 4, 5};
a.insert(b.begin(), 10);
}