playing around with D

BCS ao at pathlink.com
Tue Mar 6 09:09:19 PST 2007


Reply to Walter,

> The problem is you are expecting that the static assert is checked
> before the alias in AssertTest. Multiple semantic passes are done over
> the declarations, and static assert's aren't checked until later. To
> ensure an order, use static if, such as:
> 
> template AssertTest( T )
> {
> static if( isTupleContainer!( T ) )
> alias DoSomething!( T ).Result    AssertTest;
> else
> static assert(0);
> }

Why do the static asserts get processed later?

I'd expect that having them get processed sooner would make things work nicer.





More information about the Digitalmars-d mailing list