April 03, 2008
On 03/04/2008, Janice Caron <caron800@googlemail.com> wrote:
>  const means "I promise not to modify this". There is absolutely no
>  problem with promising not to modify something which is invariant.

There is, of course, a /huge/ problem with promising not to modify something while keeping your fingers crossed behind your back.

Promising not to modify something (which is what accepting a const parameter means), and then modifying it anyway, is called lying.
April 03, 2008
"Janice Caron" <caron800@googlemail.com> wrote in message news:mailman.304.1207217058.2351.digitalmars-d@puremagic.com...
> On 03/04/2008, Craig Black <craigblack2@cox.net> wrote:
>>  If that compiles, I think it may be a bug.  Invariant types shouldn't be
>> implicitly convertible to const.
>
> Yes they should.
>
> const means "I promise not to modify this". There is absolutely no
> problem with promising not to modify something which is invariant.

Hmmm.  Maybe you are right.  I was just thinking that since invariant is a stronger guarantee than const, it shouldn't be implicitly convertible.  But I suppose I agree with you after giving it a little more though. 

1 2
Next ›   Last »