Re: template auto value

2018-03-05 Thread Jonathan Marler via Digitalmars-d
On Monday, 5 March 2018 at 13:03:50 UTC, Steven Schveighoffer wrote: On 3/2/18 8:49 PM, Jonathan Marler wrote: On Saturday, 3 March 2018 at 00:20:14 UTC, H. S. Teoh wrote: On Fri, Mar 02, 2018 at 11:51:08PM +, Jonathan Marler via Digitalmars-d wrote: [...] Not true: template

Re: template auto value

2018-03-05 Thread Steven Schveighoffer via Digitalmars-d
On 3/2/18 8:49 PM, Jonathan Marler wrote: On Saturday, 3 March 2018 at 00:20:14 UTC, H. S. Teoh wrote: On Fri, Mar 02, 2018 at 11:51:08PM +, Jonathan Marler via Digitalmars-d wrote: [...] Not true: template counterexample(alias T) {} int x; string s; alias U =

Re: template auto value

2018-03-02 Thread Jonathan Marler via Digitalmars-d
On Saturday, 3 March 2018 at 00:20:14 UTC, H. S. Teoh wrote: On Fri, Mar 02, 2018 at 11:51:08PM +, Jonathan Marler via Digitalmars-d wrote: [...] Not true: template counterexample(alias T) {} int x; string s; alias U = counterexample!x; // OK

Re: template auto value

2018-03-02 Thread Timon Gehr via Digitalmars-d
On 03.03.2018 01:20, H. S. Teoh wrote: On Fri, Mar 02, 2018 at 11:51:08PM +, Jonathan Marler via Digitalmars-d wrote: I believe I found small hole in template parameter semantics. [...] you can't create a template that accepts a value of any type. Not true: template

Re: template auto value

2018-03-02 Thread H. S. Teoh via Digitalmars-d
On Fri, Mar 02, 2018 at 11:51:08PM +, Jonathan Marler via Digitalmars-d wrote: > I believe I found small hole in template parameter semantics. > [...] you can't create a template that accepts a value of any type. Not true: template counterexample(alias T) {} int x;

template auto value

2018-03-02 Thread Jonathan Marler via Digitalmars-d
I believe I found small hole in template parameter semantics. I've summarized it here (https://github.com/marler8997/dlangfeatures#template-auto-value-parameter). Wanted to get feedback before I look into creating a PR for it. -- COPY/PASTED from https