Proposal: static template(fail)
Bruce Adams
tortoise_74 at yeah.who.co.uk
Fri Dec 14 11:57:35 PST 2007
On Fri, 14 Dec 2007 19:09:25 -0000, BCS <ao at pathlink.com> wrote:
> what would this do?:
>
> template Foo(T)
> {
> static if(logic1!(T)) template(fail);
> }
>
> template Foo(T)
> {
> static if(logic2!(T)) template(fail);
> }
>
> from a programers level, it might be valid. My though is (an wow could
> this be costly) try all cases*, if there isn't exactly one match, error.
>
>
> * Walter's not going to like that for performance reasons.
>
I'm not so sure about that. Its a bit like saying he wouldn't like you to
write poorly designed / optimised code. He may not like it but a
programming
language can't help but permit it even if it does discourage it.
More information about the Digitalmars-d
mailing list