Concepts vs template constraints - the practical approach

Kagamin spam at here.lot
Mon Nov 21 04:16:26 PST 2011


Norbert Nemec Wrote:

> On 20.11.2011 21:07, Andrei Alexandrescu wrote:
> > On 11/20/11 10:41 AM, Norbert Nemec wrote:
> > [snip]
> >
> > Why not follow the patter of isXxx in the standard library?
> >
> > Andrei
> 
> Actually, that was my starting point. However, this approach does not 
> scale up:
> 
> A concept typically is a collection of requirements that have to be met 
> individually. A huge boolean statement inside an assertion does not give 
> any clue as to which part of it failed.
> 
> The isXxx approach works fine for the template constraint itself, but to 
> assert that a given type meets all requirements of a concept, it is not 
> very usable at all.

If an assertion fails do you want the compiler to terminate or to silently proceed to the next overload?


More information about the Digitalmars-d mailing list