Transitive const sucks
Sean Kelly
sean at f4.ca
Thu Sep 13 08:19:42 PDT 2007
Christopher Wright wrote:
> Alex Burton wrote:
>
>> I obviously don't know as much about compilers as you but, there seem
>> to be limitations that you dont seem to be able to communicate to us
>> about why you need transitive const.
>
> If you want to ensure thread safety, you either need some sort of mutex
> or you need to be able to say "Nothing will change when I do this, at
> all, so I don't need to worry about thread safety". (Well, regardless of
> whether you can say it, you need it to be true.)
A third option for thread safety would be if the function mutated only
atomic non-local data. The function wouldn't be 'pure' however.
Sean
More information about the Digitalmars-d
mailing list