y3c-stl 0.3.3
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 0x000056410998a760 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: }
可変長配列 (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);
}