Advertisement

Expressions for default arguments

Started by October 13, 2011 09:57 PM
0 comments, last by WitchLord 13 years, 1 month ago
I see that default arguments only support constants (nothing else is even parsed). Is it possible to add support for actual expressions (evaluated in the same scope as the function)? Then things like this are possible:

class T
{
int A;

void f(int a=5*A) { }
}


Currently i can't even put some of my macros as default arguments because they evaluate to things like (15), which is a proper expression but the parser dislikes the parentheses very much.
I'll look into it. It shouldn't be too difficult. Thanks for the suggestion.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement