On Friday, 1 February 2013 at 03:28:05 UTC, TommiT wrote:
On Friday, 1 February 2013 at 03:08:12 UTC, Zach the Mystic
wrote:
alias template theFuncIActuallyWant this;
int theFuncIActuallyWant() { return 1; }
...in order to have it pass the right thing to the template
parameter? That's just a jury rigged syntax which might help
structs make more sense to the compiler when passed through
templates.
None of the alias this conversions are even looked at when you
pass a variable to a templated parameter. The template simply
conforms to whatever type the passed variable is. No
conversions ever happen. That's just how templates work in D. I
can't right off the bat say that it's impossible to design a
language where templates perform conversions. But it's safe to
say that it's not happening with this language. It would be a
huge change.
What I meant to suggest was an actual new feature which would
allow one preferred argument to be passed to a template.