Am I correct in my understanding that if you wish a template function which is 
imported from another module to compile correctly without requiring other 
imports in the module that your using the function in that the module with the 
template function needs to publically import all of the functions and types 
that 
it needs?

So, if you had

----------------------
module a;

import std.algorithm;

void func(R)(R range)
{
    sort(range);
}

--------------------------
module b;

import module a;

void foobar(int[] vals)
{
    sort(vals);
}
----------------------------------


then you'd have to import std.algorithm (or std.algorithm.sort) in module b, 
and 
if you didn't want to require that, you'd do

public import std.algorithm : sort;

in module a. Is that correct? Or is my understanding off?

- Jonathan M Davis

Reply via email to