deque<X,A>& deque<X,A>::operator=(const deque<X,A>& kqrDeque);
#include <deque>
deque<X,A>& deque<X,A>::operator=(deque<X,A>&& qrrDeque);
#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');
deque<char> qCopy;
qCopy.push_back('A');
qCopy.push_back('B');
qCopy.push_back('C');
// Output the deque before the assignment
deque<char>::iterator qIter;
cout << "Deque before = ";
for (qIter = qCopy.begin(); qIter != qCopy.end(); ++qIter) {
cout << *qIter;
}
cout << endl;
cout << "Copy the deque with the assignment operator" << endl;
qCopy = qD;
// Output the deque after the assignment
cout << "Deque after = ";
for (qIter = qCopy.begin(); qIter != qCopy.end(); ++qIter) {
cout << *qIter;
}
cout << endl;
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.