void deque<X,A>::emplace_front(X&& xrrValue);
#include <deque>
#include <iostream> #include <deque> int main() { using namespace std; // Create a deque instance deque<char> qD; qD.push_back('X'); qD.push_back('o'); qD.push_back('a'); qD.push_back('X'); qD.push_back('.'); qD.push_back('n'); qD.push_back('e'); qD.push_back('t'); // Output the entries, call emplace_front and output them again deque<char>::iterator qIter; cout << "D = "; for (qIter = qD.begin(); qIter != qD.end(); ++qIter) { cout << *qIter; } cout << endl; // Call emplace_front cout << "call emplace_front()" << endl; qD.emplace_front('Z'); cout << "D = "; for (qIter = qD.begin(); qIter != qD.end(); ++qIter) { cout << *qIter; } cout << endl; // Keep the window open cin.get(); return 0; }
© 20072024 XoaX.net LLC. All rights reserved.