views:

89

answers:

1

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?

+4  A: 

This is a known issue in the Standard. Also see this usenet discussion on the topic.

Johannes Schaub - litb
Nice links. Cheers.
pt2cv