Why it is impossible to create an array of references in c++?

后端 未结 4 1542
庸人自扰
庸人自扰 2020-12-25 12:08

C++ Standard 8.3.2/4 says:

There shall be no references to references, no arrays of references, and no pointers to references.

4条回答
  •  爱一瞬间的悲伤
    2020-12-25 12:10

    A reference cannot be reassigned, and has no size.

    If arrays of references were allowed they would therefore have to be treated in a special way then.

提交回复
热议问题