Sahaj.blogs

Day page

17 Nov 2023

Study

C++ · References

References as aliases, pass-by-value vs pass-by-reference, and const references for passing big objects cheaply.

  • A reference is another name for an existing variable; it can't be null and can't be reseated.
  • Pass large objects as const T& so you avoid a copy without allowing changes.

Read the post →