////////////////////////////////////////
// 2018/04/24 20:02:33
// deque-push_back
#include <iostream>
#include <deque>
#include <string>
#include <iterator>
using namespace std;
template<class T>
class Name{
private:
T name;
public:
void print(){
cout << name << " ";
}
Name(T t) :name(t){}
};
//====================================
int main(){
typedef Name<string> N;
typedef deque<N> D;
D d;
N n1("Robert");
N n2("Alex");
d.push_back(n1);
d.push_back(n2);
//unname object of the type Name
d.push_back(N("Linda"));
D::iterator it = d.begin();
while (it != d.end()){
(it++)->print();
}
cout << endl;
return 0;
}
/*
OUTPUT:
Robert Alex Linda
*/