Thread overview
Template alias parameter mixin import inference
Mar 31, 2008
Simen Kjaeraas
March 31, 2008
The below code does not compile - it complains about writefln not being defined,
which of course it is not, in module b. Would it be possible to get import
inference for this sort of thing? I know it's currently as simple as placing
import statements within the "bar" template, but it seems to me this could have
been done in a more pleasant way.

//////////////////////

module a;
import std.stdio;

template bar()
{
	int i;
	
	void func()
	{
		writefln(i);
	}
}

void main()
{
	foo!(bar) a;
	a.func();
}

//////////////////////

module b;

struct foo(alias T)
{
	mixin T!();
}

//////////////////////

--Simen
March 31, 2008
"Simen Kjaeraas" <simen.kjaras@gmail.com> wrote in message news:op.t8vlwdfy1hx7vj@spill04.lan...

> //////////////////////
>
> module a;
> import std.stdio;

public import std.stdio;


March 31, 2008
"Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message news:fsqn0b$i7h$1@digitalmars.com...
> "Simen Kjaeraas" <simen.kjaras@gmail.com> wrote in message news:op.t8vlwdfy1hx7vj@spill04.lan...
>
>> //////////////////////
>>
>> module a;
>> import std.stdio;
>
> public import std.stdio;

Ignore me.  Thought I saw an "import a;" in module b.  ._.