On Fri, Dec 20, 2013 at 6:31 PM, Francesco Cattoglio <francesco.cattog...@gmail.com> wrote: > On Friday, 20 December 2013 at 16:40:23 UTC, monarch_dodra wrote: >>> >>> Everything works as it should, but according to "D Templates: A Tutorial" >>> book, you should not use arguments in constraints. >> >> >> That's news to me. > > It seems strange to me too, but: page 69 on the PDF: > "Do not use argument in your constraint. If you need a value of type T, use > T.init." > Since I don't know D really well, I thought something was wrong with it.
Well I wrote this, so I should explain :-) I'm pretty sure at one time, using direct symbols led to strange behavior. And I'm still not sure symbol have values when used in template constraints. What happens when you try ++a on such a symbol? But then, if people tell me using these values directly is perfectly OK, I'll update the text, of course.