4 ms·
> Heck, in the general case Rectangle might be defined in a separate DLL or .so file that doesn't get loaded until run-time. So there's no possible way for the
by cryptonector 3y ago
> Heck, in the general case Rectangle might be defined in a separate DLL or .so file that doesn't get loaded until run-time. So there's no possible way for the compiler to know its default value here.
Eh, that's not exactly true. The ABI for C++ could have included a way to look up the default values of defaulted parameters from the object's run-time class.
But the C++ ABI didn't need that. Oh, and there's no C++ ABI, but this behavior would have been part of the de facto sort-of ABIs if it had been required by the spec (but it wasn't).
That said, I agree with you that this is intuitive.