On 15 Feb 2006 03:18:01 -0800,
mi******@gmail.com wrote:
Playing a bit around with Trolltech's Qt library I noticed the
following constructor:
QProgressDialog ( const QString & labelText, const QString &
cancelButtonText, ...)
In the documentation they state that setting cancelButtonText to 0
prevents the button from being shown (and it works as stated).
How is it possible to set something to 0 inside the function when it
is passed as a const reference? Perhaps there is a const assignment
function somewhere in the definition of QString?
But shouldn't references always point to a well-defined object? Is this
valid c++?
/Mikael.
References are a kind of alias for the object they refer to. Indeed,
they must always "point to" (but watch out, references are not
pointers!) a well-defined object. When you assign something to a
reference, you are actually assigning it to the underlying object.
--
Bob Hairgrove
No**********@Home.com