Address of a reference

前端 未结 5 1085
北恋
北恋 2021-01-16 02:40

So I am having a discussion with a friend about reference and pointers.

What we got talking about is \"you can take an address of a pointer but you cant take an addr

5条回答
  •  隐瞒了意图╮
    2021-01-16 02:49

    C++ Standard n3337 § 8.3.2/4

    It is unspecified whether or not a reference requires storage (3.7).

    So this is unspecified whether reference has storage. Most probably not. It is just alias. When you use it in the code it follows that special operations are taken by compiler, it might do some things similar to pointer operations.

提交回复
热议问题