[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: Pointer to reference to QChar? (Was: Re: CSSMediaRule::insertRule)
From:       David Faure <david () mandrakesoft ! com>
Date:       2001-09-25 13:37:45
[Download RAW message or body]

On Mardi 25 Septembre 2001 15:37, Martijn Klingens wrote:
> The problem is the prototype of parseRule():
> 
> CSSRuleImpl *parseRule(const QChar *&curP, const QChar *endP);
>
> Question is why behaviour is like this. Is this intended? The combination of 
> pointer and reference (and especially the const version of this) sounds a bit 
> superfluous to me. And results in hard-to-understand errors...

Without knowing the code much, this looks very much like any parser
you'd write: there is a pointer to the current char being parsed,
and this pointer has to be passed by reference so that it gets updated
in the caller !
So the "workaround" is correct, assuming you have a single thing to parse
and that parseRule will do it all.
 
-- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://perso.mandrakesoft.com/~david/ , http://www.konqueror.org/
KDE, Making The Future of Computing Available Today

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic