C++ guys hate static_if?

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Mar 14 11:04:48 PDT 2013


On Thu, Mar 14, 2013 at 06:56:56PM +0100, Andrej Mitrovic wrote:
> On 3/14/13, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:
> > But if we have to go that far, then it begs the original question:
> > why not have the compiler do that for us?
> 
> But where do you draw the line? There could be an unlimited number of
> permutations of how a template is instantiated. This would blow up
> compilation time by an unknown factor. And I doubt this would be
> simple to implement too.

But that was my point, if we had concepts, then the compiler could
statically check the syntax of the template without needing to iterate
over all combinations of types.

Right now, we *have* to essentially check all combinations in unittests
if we want to be sure that the template is instantiable in all cases.


T

-- 
Your inconsistency is the only consistent thing about you! -- KD


More information about the Digitalmars-d mailing list