私は参照渡しとポインタ渡しのトピックが大きくカバーされていることを知っています...かなり確かに私はこれを読むまですべてのニュアンスを理解しました:
http://carlo17.home.xs4all.nl/cpp/const.qualifier.html
どの読み込み(リンクが死んだ場合)
The prototype for foobar can have any of the following footprints:
void foobar(TYPE); // Pass by value
void foobar(TYPE&); // Pass by reference
void foobar(TYPE const&); // Pass by const reference
Note that I put the const to the right of TYPE because we don't know if TYPE (this is not a template parameter, but rather for instance a literal char*) is a pointer or not!
著者は「TYPEがポインタであるかどうかわからないので、TYPEの右側にconstを置くことに注意してください!」とはどういう意味ですか?
このトピックで私が読んだことはすべて、
void foodbar(TYPE const&)
同等です
void foobar(const TYPE&)
著者を正しく理解していれば、s/heはそれを言っています:
const int * X対int * const Xポインタ、X自体はconst対Xポイントはconstですか?
もしそうなら、これは本当ですか?