Top-level const doesn't influence a function signature

后端 未结 7 1983
悲哀的现实
悲哀的现实 2020-11-27 08:32

From the C++ Primer 5th Edition, it says:

int f(int){ /* can write to parameter */}
int f(const int){ /* cannot write to parameter */}

The

相关标签:
7条回答
  • 2020-11-27 08:58

    A function is useful only from the caller's perspective.

    Since there is no difference to the caller, there is no difference, for these two functions.

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