Logical location of template instantiations

Lodovico Giaretta via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 1 12:34:00 PDT 2016


On Friday, 1 July 2016 at 19:13:45 UTC, Steven Schveighoffer 
wrote:
> On 7/1/16 3:02 PM, Timon Gehr wrote:
>>
>> The current module (that declares 'S') might not be the only 
>> module that
>> uses emplace to construct 'S' instances. We want to hide the 
>> constructor
>> of 'S' from other modules, but not from the current module.
>> But both modules get identical template instances, so either 
>> both see
>> the private constructor (through emplace), or none does. To 
>> fix this
>> properly, there should hence be a way for the two modules to 
>> receive
>> distinct template instances.
>
> Emplace needs a constructor alias parameter.
>
> -Steve

Yes, this looks like a sensible solution.


More information about the Digitalmars-d mailing list