RosettaCodeData/Task/Collections/C++/collections-3.cpp

7 lines
221 B
C++
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
#include <deque>
std::deque<int> d; // empty deque
d.push_back(5); // insert a 5 at the end
d.push_front(7); // insert a 7 at the beginning
d.insert(v.begin()+1, 6); // insert a 6 in the middle