To help LDC/GDC

Manu turkeyman at gmail.com
Mon Apr 8 06:09:14 PDT 2013


On 8 April 2013 23:01, John Colvin <john.loughran.colvin at gmail.com> wrote:

> On Monday, 8 April 2013 at 12:39:58 UTC, Manu wrote:
>
>> On 8 April 2013 21:53, Iain Buclaw <ibuclaw at ubuntu.com> wrote:
>>
>>  On 8 April 2013 12:41, deadalnix <deadalnix at gmail.com> wrote:
>>>
>>>  On Monday, 8 April 2013 at 09:41:52 UTC, Iain Buclaw wrote:
>>>>
>>>>  It uses some type information, eg:
>>>>>
>>>>> const/immutable/wild  -> qualified const.
>>>>> shared -> qualified volatile.
>>>>> shared + const/wild -> qualified const/volatile.
>>>>>
>>>>>
>>>>>  const/wild can be muted via aliasing. I'm not sure how GCC's backend
>>>> understand const, but this seems unclear to me if this is correct.
>>>>
>>>>
>>>>  GCC's backend is pretty much C/C++ semantics.  So the const qualifier
>>> is
>>> shallow, and does not guarantee that no mutations will occur.
>>>
>>>
>> But D makes no further guarantee. I don't see how const in D is any
>> different than const in C++ in that sense? That's basically the concept of
>> const, it's not a useful concept for optimisation, only immutable is.
>>
>
> D const is transitive, surely that makes a difference/presents an
> opportunity?
>

No, I think that just makes it 'safer', or as many might say, "more
annoying" ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130408/7ee2cf2b/attachment-0001.html>


More information about the Digitalmars-d mailing list