Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
back_inserter example
//clang 3.8.0 #include <algorithm> #include <iostream> #include <iterator> #include <vector> int main() { std::vector<int> src = {1, 4, 6, 4, 1}; std::vector<int> dest; // Next line crashes the process, as there is no sufficient space in the `dest` vactor. // std::copy(src.cbegin(), src.cend(), dest.begin()); std::copy(src.cbegin(), src.cend(), std::back_inserter(dest)); std::cout << "dest:"; for (auto value: dest) std::cout << " " << value; return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Array-Based Heap Example Solution
hw 1 os
Magic, why 1 2?
HTML Timetable generator.cpp
std::reference_wrapper
A
CS1428 SI Tuesday
vector destruction - clang
Bubble Sort Example
Sum of Natural Numbers using loop
Please log in to post a comment.