Re: template parameter inference and introspection

2017-02-24 Thread Meta via Digitalmars-d-learn
On Friday, 24 February 2017 at 11:17:46 UTC, John Colvin wrote: Unfortunately that only works by accident of my example. A counterexample: T foo(Q = float, T = short)(T t) { return t; } alias Typeof(alias v) = typeof(v); template getInstantiation(alias f, T...) { import std.meta;

Re: template parameter inference and introspection

2017-02-24 Thread John Colvin via Digitalmars-d-learn
On Friday, 24 February 2017 at 14:06:22 UTC, Meta wrote: On Friday, 24 February 2017 at 11:17:46 UTC, John Colvin wrote: Unfortunately that only works by accident of my example. A counterexample: T foo(Q = float, T = short)(T t) { return t; } alias Typeof(alias v) = typeof(v); template

Re: template parameter inference and introspection

2017-02-24 Thread John Colvin via Digitalmars-d-learn
On Thursday, 23 February 2017 at 18:33:33 UTC, Meta wrote: On Thursday, 23 February 2017 at 18:21:51 UTC, Meta wrote: On Thursday, 23 February 2017 at 16:01:44 UTC, John Colvin wrote: Is there any way to get a reference/alias to the instantiation of a template function that would be called,

Re: template parameter inference and introspection

2017-02-23 Thread Meta via Digitalmars-d-learn
On Thursday, 23 February 2017 at 18:21:51 UTC, Meta wrote: On Thursday, 23 February 2017 at 16:01:44 UTC, John Colvin wrote: Is there any way to get a reference/alias to the instantiation of a template function that would be called, given certain parameters? I.e. to get the result of whatever

Re: template parameter inference and introspection

2017-02-23 Thread Meta via Digitalmars-d-learn
On Thursday, 23 February 2017 at 16:01:44 UTC, John Colvin wrote: Is there any way to get a reference/alias to the instantiation of a template function that would be called, given certain parameters? I.e. to get the result of whatever template parameter inference (and overload resolution) has

template parameter inference and introspection

2017-02-23 Thread John Colvin via Digitalmars-d-learn
Is there any way to get a reference/alias to the instantiation of a template function that would be called, given certain parameters? I.e. to get the result of whatever template parameter inference (and overload resolution) has occurred? E.g. for some arbitrarily complex foo: static