2006-06-12から1日間の記事一覧
関数テンプレートとauto宣言で型推論(推論じゃないけど)。 import std.c.stdio; class Curry(T, X, Y){ this(int x0, T delegate(X, Y) f0){ x = x0; f = f0; } T opCall(Y y){ return f(x, y); } private: X x; T delegate(X, Y) f; } template curry(T, …
関数テンプレートとauto宣言で型推論(推論じゃないけど)。 import std.c.stdio; class Curry(T, X, Y){ this(int x0, T delegate(X, Y) f0){ x = x0; f = f0; } T opCall(Y y){ return f(x, y); } private: X x; T delegate(X, Y) f; } template curry(T, …