Re: const property don't wont return const reference to value

2012-12-24 Thread Jonathan M Davis
On Monday, December 24, 2012 17:25:05 Monarch Dodra wrote: > That's the way the ddoc is generated anyways: Everything on the > left. Which should probably be fixed IMHO. Regardless, in Phobos or druntime, if const is found on the left, it gets moved to the right. - Jonathan M Davis

Re: const property don't wont return const reference to value

2012-12-24 Thread Monarch Dodra
On Monday, 24 December 2012 at 15:52:01 UTC, Jonathan M Davis wrote: On Monday, December 24, 2012 14:32:55 monarch_dodra wrote: "ref" is a function qualifier, not a type qualifier, so you could even write it as: "const(ReturnType) foo() const ref;" So technically, it is symetric. I'm pretty

Re: const property don't wont return const reference to value

2012-12-24 Thread Jonathan M Davis
On Monday, December 24, 2012 14:32:55 monarch_dodra wrote: > "ref" is a function qualifier, not a type qualifier, so you could > even write it as: > "const(ReturnType) foo() const ref;" > > So technically, it is symetric. I'm pretty sure that ref is nonsensical in that example. What would ref on

Re: const property don't wont return const reference to value

2012-12-24 Thread monarch_dodra
On Sunday, 23 December 2012 at 15:05:16 UTC, Namespace wrote: On Sunday, 23 December 2012 at 14:55:30 UTC, bearophile wrote: Namespace: Shouldn't we fix this? Most of the Newcomer are confused with the fact, Take a look in bugzilla. I opened an enhancement request to fix this situation, but

Re: const property don't wont return const reference to value

2012-12-23 Thread Jonathan M Davis
On Sunday, December 23, 2012 21:34:25 Namespace wrote: > > No one has been able to convince Walter. He thinks that the > > consistency of > > allowing function attributes on both sides trumps fixing the > > problems caused by > > having const or immutable on the left. > > > > - Jonathan M Davis >

Re: const property don't wont return const reference to value

2012-12-23 Thread Namespace
No one has been able to convince Walter. He thinks that the consistency of allowing function attributes on both sides trumps fixing the problems caused by having const or immutable on the left. - Jonathan M Davis It is more confusing than anything else but as I said I would waste my time wit

Re: const property don't wont return const reference to value

2012-12-23 Thread Jonathan M Davis
On Sunday, December 23, 2012 15:41:09 Namespace wrote: > On Sunday, 23 December 2012 at 13:37:33 UTC, Rainer Schuetze > > wrote: > > On 23.12.2012 14:20, Zhenya wrote: > >> @property const ref int bar() const > > > > The first const does not bind to the return type, but to the > > whole decla

Re: const property don't wont return const reference to value

2012-12-23 Thread bearophile
Namespace: So what should I waste my time with "war" with my limited english knowledge ? ;) But thank you, that you tried it. Your English improves if you want it, and you exercise yourself. And such "wars" are not always useless, because while Walter is very experienced and usually strong

Re: const property don't wont return const reference to value

2012-12-23 Thread Namespace
On Sunday, 23 December 2012 at 14:55:30 UTC, bearophile wrote: Namespace: Shouldn't we fix this? Most of the Newcomer are confused with the fact, Take a look in bugzilla. I opened an enhancement request to fix this situation, but Walter has closed it down. The rationale is to keep uniform t

Re: const property don't wont return const reference to value

2012-12-23 Thread bearophile
Namespace: Shouldn't we fix this? Most of the Newcomer are confused with the fact, Take a look in bugzilla. I opened an enhancement request to fix this situation, but Walter has closed it down. The rationale is to keep uniform the way D manages tags like const, immutable, etc. I don't agre

Re: const property don't wont return const reference to value

2012-12-23 Thread Namespace
On Sunday, 23 December 2012 at 13:37:33 UTC, Rainer Schuetze wrote: On 23.12.2012 14:20, Zhenya wrote: @property const ref int bar() const The first const does not bind to the return type, but to the whole declaration, so it does the same as the const at the end. You should use @

Re: const property don't wont return const reference to value

2012-12-23 Thread Zhenya
On Sunday, 23 December 2012 at 13:37:33 UTC, Rainer Schuetze wrote: On 23.12.2012 14:20, Zhenya wrote: @property const ref int bar() const The first const does not bind to the return type, but to the whole declaration, so it does the same as the const at the end. You should use @

Re: const property don't wont return const reference to value

2012-12-23 Thread Rainer Schuetze
On 23.12.2012 14:20, Zhenya wrote: @property const ref int bar() const The first const does not bind to the return type, but to the whole declaration, so it does the same as the const at the end. You should use @property ref const(int) bar() const