1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
// deque::at
#include <iostream>
#include <deque>
int main ()
{
std::deque<unsigned> mydeque (10); // 10 zero-initialized unsigneds
// assign some values:
for (unsigned i=0; i<mydeque.size(); i++)
mydeque.at(i)=i;
std::cout << "mydeque contains:";
for (unsigned i=0; i<mydeque.size(); i++)
std::cout << ' ' << mydeque.at(i);
std::cout << '\n';
return 0;
}
| |