Logical location of template instantiations

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 8 09:10:13 PDT 2016


On Friday, July 08, 2016 15:08:35 Timon Gehr via Digitalmars-d wrote:
> On 08.07.2016 09:45, Jonathan M Davis via Digitalmars-d wrote:
> > On Thursday, July 07, 2016 23:20:28 Timon Gehr via Digitalmars-d wrote:
> >> On 07.07.2016 17:11, Jonathan M Davis via Digitalmars-d wrote:
> >>>    So,
> >>>
> >>> the buck would have to be passed at every point that the symbol were
> >>> passed
> >>> as an alias argument such that the check for accessibility was only done
> >>> when the symbol first became an alias.
> >>> ...
> >>
> >> No, it is way simpler than that. Just don't ever check for visibility of
> >> the symbol accessed through an alias.
> >
> > It has to be checked at some point, otherwise using a template alias
> > parameter would allow you to completely bypass the accessibility
> > modifiers.
> > It's just that it seems like it should be checked at the point where the
> > symbol is passed to the template and not within the template itself,
> > whereas right now, it's checked within the template.
> >
> > - Jonathan M Davis
>
> (That's what I said. In any case, it is simple to implement.)

Well, then I misunderstood what you meant. But if it's simple to implement,
then it seems to me that it's almost certainly the way we should go. It
would solve the accessibility problem in a clean way without having to
instantiate the template extra times.

- Jonathan M Davis



More information about the Digitalmars-d mailing list