Re: Nested template arguments

2018-08-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/22/18 11:37 AM, Alex wrote: On Wednesday, 22 August 2018 at 15:18:29 UTC, XavierAP wrote: On Wednesday, 22 August 2018 at 14:48:57 UTC, Alex wrote: Because it could be meant as the argument to some templates to the left. Like (foo!bar)!x Sure, it would be a coincidence, if both will wo

Re: Nested template arguments

2018-08-22 Thread Alex via Digitalmars-d-learn
On Wednesday, 22 August 2018 at 15:18:29 UTC, XavierAP wrote: On Wednesday, 22 August 2018 at 14:48:57 UTC, Alex wrote: Because it could be meant as the argument to some templates to the left. Like (foo!bar)!x Sure, it would be a coincidence, if both will work. However, templates are not so

Re: Nested template arguments

2018-08-22 Thread XavierAP via Digitalmars-d-learn
On Wednesday, 22 August 2018 at 14:48:57 UTC, Alex wrote: Because it could be meant as the argument to some templates to the left. Like (foo!bar)!x Sure, it would be a coincidence, if both will work. However, templates are not something where you can simply imply the associative property, I

Re: Nested template arguments

2018-08-22 Thread Alex via Digitalmars-d-learn
On Wednesday, 22 August 2018 at 14:30:39 UTC, XavierAP wrote: Why foo!bar!x is not understood as foo!(bar!x) but instead gives an error "multiple ! arguments are not allowed"? Precisely because multiple "!" can never belong to the same instantiation, why does the parser not

Nested template arguments

2018-08-22 Thread XavierAP via Digitalmars-d-learn
Why foo!bar!x is not understood as foo!(bar!x) but instead gives an error "multiple ! arguments are not allowed"? Precisely because multiple "!" can never belong to the same instantiation, why does the parser not understand without needing brackets that the rightmost template