Marc Herbert <[EMAIL PROTECTED]> writes:

>> Just one question ... what will happen with getResultSet() when
>> lastResultPtr is null?
>
> Good question :-)
>
> Could we use a different semantic to flag the end of the list? This
> one is very Java/JDBC oriented, not C++. I find it's a pity to use
> pointers to mimic null java references.
>
> On the other hand iterators - a more C++ oriented solution - are
> probably closer to the current code.

A couple more words to clarify my opinion ("La nuit porte conseil" -
nighttime brings advice).

The issue with pointers is that you always have to ask who owns the
pointed-to object. Consequences are double deletions bugs and memory
leaks. As opposed to C, C++ allows to write code with very few
pointers, and even better to encapsulate their use inside objects
(which is not the case here).

Iterators look like pointers for legacy reasons, but they don't need
to be pointers, and moreover no programmer ever asks himself if he has
to delete iterators (!).






_______________________________________________
Carob mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob

Reply via email to