On Fri, 09 May 2014 17:45:37 -0400, Vlad Levenfeld <vlevenf...@gmail.com> wrote:

Is there any way to declare a method as "safe regardless of shared/mutability/etc" (or some other way to avoid cast(Type)object.property every time I want to check a property which won't affect any state)?

Not really for shared. For everything else, there's const for value properties, and inout for reference properties.

Shared is quite different, because the method has to be cognizant of race conditions. It has to be implemented differently.

Casting away shared is somewhat dangerous, but OK if you logically know there is no race condition.

-Steve

Reply via email to