Hello (Robert),

 as I couldn't build M after updating from the cvs today using VC6 I had to
look at pointers.h and, as you might have noticed, this resulted in some
changes.

 First of all, I documented the class. I know that we don't generate
doxygen docs regularly right now but this is really not an excuse to not
write comments for the new code.

 Second, I removed implicit conversions of RefCounter<T> to "T *" and to
"bool". This is by far too dangerous and, especially with the bool one,
quite unnecessary -- there is a nice trick to avoid having it without
losing the ability to write code as if it were there, have a look at
unspecified_bool_type definition (shamelessly stolen from boost).

 Third, I've added Get() and Release() to be more consistent with the old
smart pointers and std::auto_ptr<> (and probably should have added Reset()
too).

 Fourth, I've inlined all the functions you had because they were not
inlined before (you'd have to define them before hte point of use for this
to happen but in this particular case I really don't see any point in
having them at all). I'd also like to inline RefCounterIncrement/...()
functions, I see no reason for hiding them in MObject.cpp, everybody
includes MObject.h anyhow.

 I'd like to ask you to do the same changes for AutoPtr which I didn't have
time to fix (nor did I have to as I didn't have compilation problems with
it...). Also, I'd like to rename it to ScopedPtr because this is what it is
and calling it AutoPtr is just too confusing. I'd also like to remove
AttachAndIncRef() because IMHO it is confusing and thus dangerous to have
ctor which takes ownership of the pointer and a function which doesn't (if
we decide to keep it I think to something like CopyFrom() makes more sense
as a name for it, but this is a minor issue).

 If you object to anything I did, please let me know, but I do hope that we
can agree on this interface.

 Thanks!
VZ



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Mahogany-Developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-developers

Reply via email to