I think, there is a common situation, when one function (a) is being called from within another one (b), while 'a' have some default parameters and 'b' is needed to support them. For example:
void a(int v1, int v2=0, int v3=1);
void b(int m1, int m2, int v1, int v2=0, int v3=1) {
// ...
a(v1, v2, v3);
// ...
}
But this is the violation of the DRY principle. It can leads a subtile bug, when default parameter of 'a' was changed, but not changed in 'b':
void a(int v1, int v2, int v3=0);
void b(int m1, int m2, int v1, int v2=0, int v3=1) {
// ...
a(v1, v2, v3);
// ...
}
Why there is no mechanism in C++ to inherit default parameter values? It might look like:
void a(int v1, int v2=0, int v3=1);
void b(int m1, int m2, int v1, int v2=default(a::v2, 0), int v3=default(a::v3, 1)) {
// ...
a(v1, v2, v3);
// ...
}
Whether there are languages, that have such syntax?
It might be an offtopic on this board?