Should this work?

Jakob Ovrum jakobovrum at gmail.com
Mon Jan 13 00:06:44 PST 2014


On Saturday, 11 January 2014 at 05:45:41 UTC, H. S. Teoh wrote:
> It's not just about custom error messages; it's about picking 
> up a
> particular template signature even when you don't have an 
> implementation
> for it, because logically speaking, your set of overloads 
> *should* pick
> up all such instantiations to begin with. This is why I 
> differentiated
> between the scope of a template, vs. the actual available 
> overloads.
>
> With sig constraints, you're declining instantiations that 
> don't satisfy
> certain conditions; I'm arguing that sometimes you *want* to 
> accept
> instantiations that you currently don't implement (yet), 
> because it
> falls under the logical scope of what you intend to handle; you 
> just
> haven't gotten around to actually implementing it yet.

There is nothing stopping you from writing constraints that 
accept currently unimplemented instantiations. There is no 
difference here with the two approaches.


More information about the Digitalmars-d mailing list