== Quote from Bill Baxter (wbax...@gmail.com)'s article > Cool. I don't see anything D2 specific there, so I think it should > work in D1 ok. > std.traits.ParameterTypeTuple and std.traits.ReturnType both exist in > D1, if that's what you were worried about. > I think there may be a problem with 0-arg functions in the code? > You handle the void return type (which I'm not sure is necessary > actually -- I think D lets you say "return foo()" for a void function > specifically to handle this kind of template situation), but I think > maybe you don't handle a void argument? I'm getting an error with > that for some reason... will dig more. > --bb
IDK, it works for me on DMD 2.21, including the no arguments case. Your mileage may vary on other compiler versions, since this is some really hackish metaprogramming.