| Thread overview | |||||
|---|---|---|---|---|---|
|
March 31, 2008 Template alias parameter mixin import inference | ||||
|---|---|---|---|---|
| ||||
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 Re: Template alias parameter mixin import inference | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Simen Kjaeraas | "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 Re: Template alias parameter mixin import inference | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | "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. ._. | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply