29.07.2012, 22:09
Today I learned that there exists a keyword named "defined", its design is very much same as sizeof though its functionality is similar to "#if defined" pre-processor construct. "defined" keyword resolves at compile-time to constant-expression(in this case bool: tagged). Its functionality is to deduce existance of either local or global variable, function, state variable or macro.
Syntax: (parentheses are optional)
Syntax: (parentheses are optional)
Код:
if(defined symbol) {} if(defined(symbol)) {} new const symbol_exists = defined(symbol);