Is there any kind of automatic pointer, similar to auto_ptr
or scoped_ptr
, for Symbian?
views:
23answers:
1
+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
2010-07-09 06:01:32
I supposed as much, but I meant something like Boost. Of course such classes CAN be written.
Lev
2010-07-11 04:45:15
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
2010-07-11 04:57:00