Is the const value parameter in definition but not declaration really C++?

前端 未结 7 1254
时光说笑
时光说笑 2021-01-06 13:31

This is similar to (but different from) this question.

Here is some simple test code to illustrate some weirdness I have discovered with Sun CC:

//--         


        
相关标签:
7条回答
  • 2021-01-06 14:20

    The 'const' in the 'const int' parameter should be ignored by the compiler. However, the difference between the declaration and the definition is bad style, to say the least.

    0 讨论(0)
提交回复
热议问题