Re: Proposal: prettify template constraints failure messages

2013-01-04 Thread Jonathan M Davis
On Friday, January 04, 2013 18:16:44 Dmitry Olshansky wrote: > I think we should just introduce an "else" or "default" constraint. For > example: > > void chain(Ranges...)(Ranges rs) default > { > static assert("std.range.chain requires: Any number of Input Ranges > all having a common type among

Re: Proposal: prettify template constraints failure messages

2013-01-04 Thread Dmitry Olshansky
I'm reposting message from Don Clugston. Somehow it's not on the list and reply-to email address looks inaccessible. On 02/01/13 22:25, Dmitry Olshansky wrote: > The proposal is to extend template constraint from: > > if() > to > if(; ) > > Where the is CTFE-able expression with type string.

Re: Proposal: prettify template constraints failure messages

2013-01-02 Thread Jonathan M Davis
On Wednesday, January 02, 2013 23:02:12 monarch_dodra wrote: > That said, I think another field of improvement we should > concentrate in phobos is to have a single public entry point, and > then privately forward to private specialized overloads. > > Users really shouldn't have to deal with funct

Re: Proposal: prettify template constraints failure messages

2013-01-02 Thread monarch_dodra
On Wednesday, 2 January 2013 at 21:43:31 UTC, Jonathan M Davis wrote: On Thursday, January 03, 2013 01:25:17 Dmitry Olshansky wrote: What do you think? Hmmm. Typically the thing that you really want to know is which portions were true and which were false, and this doesn't help with that at

Re: Proposal: prettify template constraints failure messages

2013-01-02 Thread Jonathan M Davis
On Thursday, January 03, 2013 01:25:17 Dmitry Olshansky wrote: > What do you think? Hmmm. Typically the thing that you really want to know is which portions were true and which were false, and this doesn't help with that at all. What it does is make the errors more understandable for newbies, wh

Proposal: prettify template constraints failure messages

2013-01-02 Thread Dmitry Olshansky
The proposal is to extend template constraint from: if() to if(; ) Where the is CTFE-able expression with type string. The message-expr yields a hint string for compiler to show when instantiation failed instead of full expression that failed. It has to be CTFE-able even if template instant