パラメータ内のconstの位置の違い[重複]
-
20-12-2019 - |
質問
これは尋ねられたかもしれず、ばかげた質問かもしれませんが、これらの違いは何ですか:
void f(int const& par);
void f(const int& par);
解決
違いはありません、constは最初に来ない限り左に適用され、次に右に適用されます。
所属していません StackOverflow
質問
これは尋ねられたかもしれず、ばかげた質問かもしれませんが、これらの違いは何ですか:
void f(int const& par);
void f(const int& par);
解決
違いはありません、constは最初に来ない限り左に適用され、次に右に適用されます。