He tried something like this that doesn't work. Is there any way to get a similar effect?
class A { public: int foo(); void bar(int b = foo()); };
Yes. Overload the function and call the member function in it.
void bar() { bar(foo()); }
Source: https://habr.com/ru/post/1338463/More articles:Sort products by 2 attributes in magento catal - sqlWhat is the MySQL Query Hitrate% value cache? - mysqlAllow pmd rule set in Maven locally - maven-2How to get EasyMock mock to return an empty list multiple times - javaThe ViewScope constructor is called twice, not sure why - javaAndroid game player - androidMap Behavior (/ @) - wolfram-mathematicaWhat files in service links must be deployed to use the WCF service? - wcfTime zones in PHP, Date, MySQL ...? - dateHow to apply django / jinja2 "escape" and "linebreaks" filter templates? - pythonAll Articles