How is one supposed to use a std container\'s value_type?
I tried to use it like so:
#include
using namespace std;
template
Here is a full implementation of the accepted answers above, in case it helps anyone.
#include
#include
template
class C1 {
private:
T container;
typedef typename T::value_type CT;
public:
void push(CT& item) {
container.push_back(item);
}
CT pop (void) {
CT item = container.front();
container.pop_front();
return item;
}
};
int main() {
int i = 1;
C1 > c;
c.push(i);
std::cout << c.pop() << std::endl;
}