Keynslug Keynslug - 1 year ago 98
C++ Question

How is reference implemented internally?

Just wonder how is it implemented actually across different compilers and debug/release configurations. Does standard somehow provides recommendations on its implementation? Does it differ anywhere?

I tried to run a simple program where i have been returning non-const references and pointers to local variables from functions but it worked out the same way. So is it true that reference internally is just a pointer?

Answer Source

The natural implementation of a reference is indeed a pointer. However, do not depend on this in your code.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download