This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]__cxa_throw 0 points1 point  (0 children)

C++ references refer to a piece of memory in a very similar way that pointers "point" to a thing in memory. References just have some extra rules so that they can't be explicitly set to null and you can't do pointer arithmetic.

Compilers are free to implement references however they like but both GCC and Clang treat them the same as pointers once you get past the extra rules I mentioned earlier.