reference

A const reference is a reference that may refer to a const object.

 

const reference is reference to const.

 

nonconst reference is reference to a nonconst type.

 

 

 

A nonconst reference may be attached only to an object of the same type as the reference itself.

A const reference may be bound to an object of a different but related type or to an rvalue. (when bound to an object of a different but related type, compiler may give a warning.)

 

 

發佈了35 篇原創文章 · 獲贊 1 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章