View mode: basic / threaded / horizontal-split · Log in · Help
March 03, 2008
Re: opMul
Yep, that did the trick.

IIRC, the const in front means const(this)
March 03, 2008
Re: opMul
Looks like a compiler bug. The trailing const should work.
March 03, 2008
Re: opMul
Walter Bright wrote:
> Looks like a compiler bug. The trailing const should work.

No, not a bug.  That seems to work fine.
What doesn't work is doing it *without* const either in front or at the 
end.  And that's correct behavior.

--bb
March 04, 2008
Re: opMul
On Tue, 04 Mar 2008 08:33:00 +0900, Bill Baxter wrote:

> and apparently const at the end means that too, now.
> 
>    	Foo opMul(const Foo b) const  { // also ok
>                ...
>          }
> 
> 
> --bb

I think that was said to be something that's going to be fixed (at some
point).
March 04, 2008
Re: opMul
On Mon, 03 Mar 2008 14:47:56 -0800, Walter Bright wrote:

> Looks like a compiler bug. The trailing const should work.

So the trailing const will be kept?

Why have it both ways?

(even though there are other things that can be specified in multiple ways)

*joking* Not very pythonic... *joking*
March 04, 2008
Re: opMul
On 03/03/2008, Bill Baxter <dnewsgroup@billbaxter.com> wrote:
> I can't keep up here.  Is a trailing 'const' legal D syntax now?

For member functions, yes.
March 04, 2008
Re: opMul
On Tue, 04 Mar 2008 00:31:38 +0100, Bill Baxter  
<dnewsgroup@billbaxter.com> wrote:

> Walter Bright wrote:
>> Looks like a compiler bug. The trailing const should work.
>
> No, not a bug.  That seems to work fine.
> What doesn't work is doing it *without* const either in front or at the  
> end.  And that's correct behavior.
>
> --bb


Bill, take a look at my code. The opMul with trailing const clearly  
changes this.bar, thus it's a bug.
March 04, 2008
Re: opMul
Simen Kjaeraas wrote:
> On Tue, 04 Mar 2008 00:31:38 +0100, Bill Baxter 
> <dnewsgroup@billbaxter.com> wrote:
> 
>> Walter Bright wrote:
>>> Looks like a compiler bug. The trailing const should work.
>>
>> No, not a bug.  That seems to work fine.
>> What doesn't work is doing it *without* const either in front or at 
>> the end.  And that's correct behavior.
>>
>> --bb
> 
> 
> Bill, take a look at my code. The opMul with trailing const clearly 
> changes this.bar, thus it's a bug.

Ah, ok.  My mistake.  I don't usually look at the groups with threading 
on because the threads just get too darn deep. And Walter's reply 
contained no context, so I thought he was responding to Denton's part of 
the thread about things compiling.

--bb
March 06, 2008
Re: opMul
Denton Cockburn wrote:
> Yep, that did the trick.
> 
> IIRC, the const in front means const(this)
> 

and apparently const at the end means that too, now.

       Foo opMul(const Foo [b]) const  { // also ok
              ...
        }


--bb
March 06, 2008
Re: opMul
On Thu, 06 Mar 2008 03:04:39 +0300, Bill Baxter  
<dnewsgroup@billbaxter.com> wrote:

> Denton Cockburn wrote:
>> Yep, that did the trick.
>>
>> IIRC, the const in front means const(this)
>>
>
> and apparently const at the end means that too, now.
>
>         Foo opMul(const Foo [b]) const  { // also ok
>                ...
>          }
>
>
> --bb


This syntax looks less confusing to me. Why keep both?
1 2 3
Top | Discussion index | About this forum | D home