Better error messages - from reddit

jmh530 john.michael.hall at gmail.com
Mon Mar 4 18:18:14 UTC 2019


On Monday, 4 March 2019 at 15:47:12 UTC, H. S. Teoh wrote:
> [snip]
>
> This is why years ago I said both here and in the Phobos PR 
> queue that sig constraints need to be written in such a way 
> that anything that *might* possibly be intended for that 
> function ought to be accepted, and static ifs should be used 
> inside the function body to dispatch to the code that handles 
> the corresponding template arguments, with an > assert(0) at 
> the end that tells you why the arguments weren't matched. [snip]

What would be an example of a signature constraint that you think 
would be worth keeping? I.e., why not do everything with static 
ifs?


More information about the Digitalmars-d mailing list