views:

23

answers:

1

Is there any kind of automatic pointer, similar to auto_ptr or scoped_ptr, for Symbian?

+1  A: 

Unfortunately, no. If you mean native Symbian C++, of course. I can only propose you to use template <class T> class TAutoClose, which can be used to call Close() method on different R-classes, when TAutoClose instance goes out of scope. For example,

RFile myFile;
TAutoClose<RFile> iFile;
iFile.iObj = myFile;

myFile::Close() will be called when iFile goes out of scope.

Hope this helps. Symbian development is not the easy. :)

Haspemulator
I supposed as much, but I meant something like Boost. Of course such classes CAN be written.
Lev
Sure they can. Speaking about Boost, it is available for Symbian as a part of Open C++ plugin, but Open C++ is often not an option (at least for many of my Symbian programming tasks).
Haspemulator