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

前端 未结 7 1380
时光说笑
时光说笑 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条回答
  •  萌比男神i
    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.

提交回复
热议问题