Shared method problem
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Wed Feb 12 08:25:37 PST 2014
On 2/12/14, 6:00 AM, Stanislav Blinov wrote:
> To be concise: don't put all your eggs into one basket. If you want
> shared class - write shared class.
>
>> Is there really need to allow shared objects different methods, and
>> non-shared objects different methods? Why don't we separate
>> implementation instead of methods according to being shared?
>
> Exactly. Separate implementations. Completely. Shared is not just about
> "insert synchronized everywhere and be done with it". As a storage
> class, it tells the compiler "don't reorder accesses to this variable".
Yah, disallowing code sharing is an intentional limitation of "shared".
I'm glad that works :o).
Andrei
More information about the Digitalmars-d
mailing list