Specialized template in different module

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Mar 14 06:36:07 PDT 2016


On Monday, 14 March 2016 at 08:42:58 UTC, John wrote:
> If I define a template in one module, and specialize it in a 
> second module, the compiler doesn't like it when I try to call 
> a function using the template.

> If I put everything in the same module it works. So are 
> template specializations limited to the same module?

Package and module names are mangled into symbol names, which 
means templates declare in different modules will always be 
different templates. It's what allows you to disambiguate between 
conflicting symbols.


More information about the Digitalmars-d-learn mailing list