extragear/multimedia/amarok/src

Ian Monroe ian at monroe.nu
Thu Oct 23 03:48:38 CEST 2008


On Wed, Oct 22, 2008 at 8:21 PM, Jeff Mitchell
<kde-dev at emailgoeshere.com> wrote:
> No, it's not ignored...trying to modify the object without const casting
> it will result in a compile error.
>
> For that reason, it's not misleading either.  The const is a warning to
> the caller that they should not be modifying that object, and since the
> compiler will force this upon them, it's far from misleading; it's very
> direct and specific.

You can't modify an int or a long.

You can modify a QString, though it's a copy so you wouldn't be
modifying the original. I suppose I could see it being good for
legibility assuming the compiler would actually error out with

 QString hello = blah.world();

Where world was defined as 'const QString world();'

I've never seen such an error before.

Ian


More information about the Amarok-devel mailing list