reference deque<X,A>::back();
#include <deque>
const_reference deque<X,A>::back() const;
#include <iostream>
#include <deque>
int main()
{
using namespace std;
// Create two deque instances
deque<int> qD1;
qD1.push_back(3);
qD1.push_back(4);
deque<int> qD2;
qD2.push_back(9);
qD2.push_back(7);
// Get references to the last entries
int& irIntRef = qD1.back();
const int& kirConstIntRef = qD2.back();
cout << "The last entry of D1 = " << irIntRef << endl;
cout << "The last entry of D2 = " << kirConstIntRef << endl;
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.