Postblit bug

IgorStepanov via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 17 09:19:46 PDT 2014


On Friday, 17 October 2014 at 15:20:50 UTC, ketmar via 
Digitalmars-d wrote:
> On Fri, 17 Oct 2014 14:41:36 +0000
> IgorStepanov via Digitalmars-d <digitalmars-d at puremagic.com> 
> wrote:
>
>> What happends if we will ignore const/immutable modifier for 
>> postblits? Is it create any holes?
> it will break "const promise". i.e. "const/immutable data is 
> not really
> immutable now, it can be modified".

It's just common words=)
I meant that when postblit is called when new object is being 
creating and doesn't exists for user code.
E.g.
const S v1 = v2;
Ok, v1 _will_ be const when it will be _created_.
However postblit can think that object is mutable, because it 
called before the first accessing to the object from user code.
Thus I ask about case when postblit may mutate a const object, 
which created before postblitted object and may been accessed 
from user code before this postblitting.


More information about the Digitalmars-d mailing list