http://d.puremagic.com/issues/show_bug.cgi?id=11379
--- Comment #1 from Andrej Mitrovic <[email protected]> 2013-10-29 11:17:04 PDT --- A use-case could be to apply a linkage from a source function type to a target function type, for example: ----- import std.string; import std.traits; template ApplyLinkage(Source, Target) { enum link = functionLinkage!Source; mixin(q{ alias extern(%s) %s ApplyLinkage; }.format(link, Target.stringof)); } extern(C) void foo() { } void main() { alias Bar = int function(int); Bar bar; alias C_bar = ApplyLinkage!(typeof(foo), Bar); C_bar cBar; Bar func; func = bar; // ok, succeeds func = cBar; // ok, fails } ----- Currently the .stringof trick is necessary due to this bug. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
