On Thu, Jul 15, 2021 at 05:21:45PM +0000, Tejas via Digitalmars-d-learn wrote: > I can do it like this in C++: > ``` > template<class abc> > class def > { > friend typename abc; > } > ``` > > I am just hopelessly confused on how to achieve the same in D.
D does not have `friend` declarations. Equivalent functionality is achieved by `private` being module-private rather than aggregate-private, meaning that all you have to do is to put `abc` in the same module as `def`, and it will have access to all `def`s private members. If, however, you're trying to inject friend access to something outside def's module, then you might want to reconsider what you're trying to accomplish and whether it can be done differently. T -- Obviously, some things aren't very obvious.