typedef (address-sized int) deque<X, A>::difference_type;
#include <deque>
#include <iostream>
#include <deque>
int main()
{
using namespace std;
// Create a deque and add four elements to it
deque<int> qDeque;
qDeque.push_back(5);
qDeque.push_back(101);
qDeque.push_back(-4);
qDeque.push_back(32);
// Get the difference between the ends and output it
deque<int>::difference_type qDiff = (qDeque.end() - qDeque.begin());
cout << "The difference is " << qDiff << endl;
// Keep the window open
cin.get();
return 0;
}
© 20072025 XoaX.net LLC. All rights reserved.