J
Jarek Blakarz
Hi
I'm trying to compile the following program.
It does not compile.
Unfortunately I don't understand the compile error messages.
Please help me understanding what's going wrong and give me some indications of
how to fix it.
thanks
#include <memory>
#include <vector>
#include <iostream>
#include <string>
using namespace std;
class X {};
int main(void)
{
vector<auto_ptr<X> > vecXP;
auto_ptr<X> xPtr(new X);
vecXP . push_back(xPtr);
auto_ptr<auto_ptr<X> > elem = vecXP[0]; // compiler error
return 0;
}
I'm trying to compile the following program.
It does not compile.
Unfortunately I don't understand the compile error messages.
Please help me understanding what's going wrong and give me some indications of
how to fix it.
thanks
#include <memory>
#include <vector>
#include <iostream>
#include <string>
using namespace std;
class X {};
int main(void)
{
vector<auto_ptr<X> > vecXP;
auto_ptr<X> xPtr(new X);
vecXP . push_back(xPtr);
auto_ptr<auto_ptr<X> > elem = vecXP[0]; // compiler error
return 0;
}