On 7/5/16 1:46 PM, Tofu Ninja wrote:
Sorry if this has been posted before.


Pretty recently actually: https://forum.dlang.org/post/[email protected]

One possible solution could be that templates have the access rights of
the instantiating scope. This is honestly what I expect most of the time
but there are probably cases where this would muck things up. Maybe a
more case by case solution would be better.

The clear problem with this solution is that this means you must use the instantiating module as part of the template definition. A template instantiation with exactly the same parameters must behave exactly the same, no matter where it was instantiated from.

What this means, is that each instantiation is now tied to the module instantiating it, with no code reuse. I think at the very least, this should be opt-in if it even makes sense to do.

-Steve

Reply via email to