I have a program that declares an auto-pointer in the header file, and
then instantiate the pointer in the code file.
i.e.
tester.hpp
~~~~~~~
// My Class
#include "pulldownmenu.hpp"
//STD
#include <memory>
class Tester {
public:
Tester();
~Tester();
private:
PulldownMenu* pdm;
};
tester.cpp
~~~~~~~~
Tester::Tester(){
std::auto_ptr<PulldownMenu> pdm(jPulldownMenu);
}
Tester::~Tester(){}
=====
However, I have seen examples where the pointer is declared and
instantiated in the header file, i.e.
class Tester {
public:
Tester();
virtual ~Tester();
private:
std::auto_ptr<jme::PulldownMenu> pdm(jme::PulldownMenu);
};
=======
What difference does it make? the two ways compile OK!
pls go easy on me, I am new a this auto_ptr thing... :)
_______________________________________________
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus