shared - i need it to be useful

12345swordy alexanderheistermann at gmail.com
Tue Oct 23 00:08:04 UTC 2018


On Monday, 22 October 2018 at 23:39:37 UTC, Walter Bright wrote:
> On 10/22/2018 7:31 AM, Timon Gehr wrote:
>> [...]
>
> One possible workaround is to use PIMPL. Another is to put the 
> @trusted privates in a separate module.
>
> The rationale behind module access to privates is:
>
> 1. avoid the whole ugly C++ "friend" complexity
>
> 2. presumably someone with privileges to edit a module can be 
> trusted to behave
>
> 3. the module is the level of encapsulation

Quick question, if a class import a module in its scope, does it 
carry its own copy when creating multiple objects with it?

-Alex


More information about the Digitalmars-d mailing list