Is it possible to use member function call as default argument?
Here is my code: struct S { int f() { return 1; } int g(int arg = f()) { return arg; } }; int main() { S s; return s.g(); } This fails to compile with the error: error: cannot call …
Online Free Tutorials Guruji Guide & Materials – Solved Questions Answers
Here is my code: struct S { int f() { return 1; } int g(int arg = f()) { return arg; } }; int main() { S s; return s.g(); } This fails to compile with the error: error: cannot call …