On Tuesday, 11 September 2018 at 13:08:46 UTC, Steven Schveighoffer wrote:
On 9/10/18 7:00 PM, Nicholas Wilson wrote:
On Monday, 10 September 2018 at 20:44:46 UTC, Andrei Alexandrescu wrote:
On 9/10/18 12:46 PM, Steven Schveighoffer wrote:
On 9/10/18 8:58 AM, Steven Schveighoffer wrote:
I'll have to figure out why my specialized range doesn't allow splitting based on " ".

And the answer is: I'm an idiot. Forgot to define empty :) Also my slicing operator accepted ints and not size_t.

I guess a better error message would be in order.

https://github.com/dlang/DIPs/pull/131 will help narrow down the cause.

While this would help eventually, I'd prefer something that just transforms all the existing code into useful error messages. See my response to Andrei.

-Steve

Please tell me where to get one of those!

But yeah, that DIP will tell you that has slicing is you problem straight away. Extracting useful information to present to the user on why hasSlicing!R is false is much trickier for the same reason that providing useful information in the current template constraint format is hard: it is a bunch of potentially unstructured logic that has already been const-folded in order to evaluate it in the first place, so you can't re-evaluate it without flushing the template cache.

That's not to say that the situation can't be improved beyond what the DIP specifies, but I haven't had any brilliant ideas (and the Idea for that DIP was stolen from someone else anyway).

Reply via email to