extragear/multimedia/amarok/src

Dan Meltzer parallelgrapefruit at gmail.com
Thu Oct 23 04:29:11 CEST 2008


On Wed, Oct 22, 2008 at 9:48 PM, Ian Monroe <ian at monroe.nu> wrote:
> 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();'

But, debug() << blah.world().toUpper();

Would error out.  Of course if you make a copy its no longer const....
isn't that the point?
>
> I've never seen such an error before.
>
> Ian
> _______________________________________________
> Amarok-devel mailing list
> Amarok-devel at kde.org
> https://mail.kde.org/mailman/listinfo/amarok-devel
>


More information about the Amarok-devel mailing list