static if on types like double, float

Oskar Linde oskar.lindeREM at OVEgmail.com
Wed Jun 14 06:21:31 PDT 2006


sclytrack at pi.be wrote:

> 1. How can I do a static if on a type? (Thanks in advance.)

See the is-expression:

http://www.digitalmars.com/d/expression.html#IsExpression

example:

static if (is (T == double)) {
	something();
} else {
	something_else();
}

/Oskar



More information about the Digitalmars-d-learn mailing list