alias this and array popFront: is this a bug?

Jonathan M Davis jmdavisProg at gmx.com
Tue Mar 12 07:43:45 PDT 2013


On Tuesday, March 12, 2013 12:28:29 monarch_dodra wrote:
> IMO, I think accepting the S type makes sense. Thoughts?

Honestly, I find implicit conversion on template constraints to be very 
dangerous, because it's so insanely easy to get something that passes the 
constraint but doesn't actually work with the code (which is a big reason that 
isDynamicArray only works on the exact type). So, I'm not really a fan of the 
idea of the alias this working like you're trying to do. But the fact that 
it's inconsistent definitely isn't good. It should either work with both front 
and popFront or reject both.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list