The C++ standard mandates that all conforming implementations support the following two signatures for main
:
int main();
int main(int, char*[]);
In case of the latter signature, would the addition of (top-level) const
-ness break any language rules?
For example:
int main(const int argc, char** const argv)
;
From my understanding, top-level const
qualification doesn't affect the function's signature hash, so it should be legal as far as the specification is concerned.
Also, did anyone ever encounter an implementation which rejected this type of modification?
This is a known issue in the Standard. Also see this usenet discussion on the topic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With