• Advertisement
Sign in to follow this  

Expressions for default arguments

This topic is 2320 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement