Re: using auto_ptr (only)
I'd like to know the answer too!
Re: using auto_ptr (only)
A using declaration brings in a name. It doesn't matter if the type is incomplete, or if the name is even a type.
You want:
#include <memory>
using std::auto_ptr;
auto_ptr<CWnd> pToWindow; // works
Later,
Chris Tracy
[email protected]
Re: using auto_ptr (only)
Hi Chris,
I tried it but the compiler complained on the using line saying:
error C2955: 'auto_ptr' : use of class template requires template argument list
Thanks for your response,
Alvaro
Re: using auto_ptr (only)
I hadn't seen that problem since VC5, so I suspect that the "correct" answer is to upgrade to VC6sp3.
Until then, I believe either:
using std::auto_ptr<CFile>
or
using namespace std;
should work.
Truth,
James
http://www.NJTheater.com
http://www.NJTheater.com/JamesCurran