Why Can't I store references in a `std::map` in C++?

后端 未结 6 1148
执念已碎
执念已碎 2020-12-02 19:55

I understand that references are not pointers, but an alias to an object. However, I still don\'t understand what exactly this means to me as a programmer, i.e. what are re

6条回答
  •  伪装坚强ぢ
    2020-12-02 20:34

    This post explains how pointers are implemented under the hood - http://www.codeproject.com/KB/cpp/References_in_c__.aspx, which also supports sebastians answer.

提交回复
热议问题