On Friday, 27 June 2014 at 06:21:11 UTC, Uranuz wrote:
On Friday, 27 June 2014 at 06:14:48 UTC, pgtkda wrote:
On Friday, 27 June 2014 at 06:12:57 UTC, pgtkda wrote:
How I could make this
working without explicit specifying of types?
sorry, i should read better
Ok. Maybe it was discussed already somewhere, but I am not god
in searching in English. Is there any directions about it? How
could I work around it? Should I mail some proposal or bug
report for it?
I think, D is a typesafe language, therefore you can't use
variables with no type declaration.
One thing you can search for, are templates but even there you
have to define a type:
import std.stdio;
enum Category : string { first = "first"}
template Pair(T)
{
T t;
T cat;
}
void main()
{
alias Pair!(string) a;
a.cat = Category.first;
a.t = "first";
writeln(a.cat, " . ", a.t);
}