On 09/02/2016 03:15 PM, Manu via Digitalmars-d wrote:
> In C++, there is this ADL thing (argument dependent lookup).
> What it does is, when searching for overloads, in addition to looking
> in the local namespace, it also looks in the namespace of the function
> arguments.

AFAIR it is intentionally not supported to simplify symbol lookup rules.

> I have the same configuration across 2 modules in D.
> In one module, I receive the foreign modules type via template arg,
> but I haven't imported that type's module, so when I try to call the
> function it can't find the overload, because it's not imported, and it
> doesn't search the argument type's module (ie, namespace) for
> overloads.

Don't know about best practice but I tend to simply find the host module
for the argument and mixin the import for it inside the template to make
symbols directly available.

Attachment: signature.asc
Description: OpenPGP digital signature

  • ADL Manu via Digitalmars-d
    • Re: ADL David Nadlinger via Digitalmars-d
    • Re: ADL Dicebot via Digitalmars-d
    • Re: ADL Steven Schveighoffer via Digitalmars-d
    • Re: ADL Cauterite via Digitalmars-d
    • Re: ADL Walter Bright via Digitalmars-d
      • Re: ADL Manu via Digitalmars-d
      • Re: ADL Walter Bright via Digitalmars-d
        • Re: ADL Stefan Koch via Digitalmars-d
          • Re: ADL Walter Bright via Digitalmars-d
            • Re: ADL Manu via Digitalmars-d
            • Re: ADL Walter Bright via Digitalmars-d
              • Re: ADL Walter Bright via Digitalmars-d

Reply via email to