Jump to content
  • Advertisement
Sign in to follow this  

Expressions for default arguments

This topic is 2924 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!