lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[2]: [lmi] Why does this crash?


From: Vaclav Slavik
Subject: Re: Re[2]: [lmi] Why does this crash?
Date: Tue, 20 Apr 2010 20:06:00 +0200

Hi,

On Sat, 2010-04-17 at 18:45 +0200, Vadim Zeitlin wrote:
>  > The second problem could be fixed by returning a value -- in light
> > of the principle you brought up, this should be backward compatible
> > and not result in any problems (or am I missing something?).
> 
>  I don't see any reason to not do this and it would be an improvement
> IMHO.

I missed one thing: we need to implement both operator*() and
operator->(). And while the former can be done easily, the latter must
return a pointer.

Is there some trick I am missing? If not, then the only fix I can think
of is caching dereferenced values in iterator (which isn't worth it,
IMHO) or change the way xmlwrapp work completely to always have
xml::node instances and not just the underlying libxml2 representation.

Or -- and this may actually be a good idea -- store xml::node in
xmlNode's _private field (for app data) the first time it is accessed.
This would fix both issues naturally and would speed up repeated access
to the same node. And because xml::node creation already involves
dynamic allocation, it could probably be done without degrading
performance...

Vaclav





reply via email to

[Prev in Thread] Current Thread [Next in Thread]