reference deque<X,A>::front();
#include <deque>
const_reference deque<X,A>::front() 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 first entries int& irIntRef = qD1.front(); const int& kirConstIntRef = qD2.front(); cout << "The first entry of D1 = " << irIntRef << endl; cout << "The first entry of D2 = " << kirConstIntRef << endl; // Keep the window open cin.get(); return 0; }
© 20072024 XoaX.net LLC. All rights reserved.