245
I can see the reference!
(feddit.nl)
Post funny things about programming here! (Or just rant about your favourite programming language.)
In my experience, it's rare to see
int&
in day to day as a regular old lvalue... it essentially just allows you to alias a variable to another name. It's much more common to see them used in function parameters to leverage pass by reference. In C++ pointers usually aren't particularly useful compared to just passing things by reference since stack variables get auto-gc'd it's the preferred style of frameworks like Qt and is extremely easy to use.Here's a breakdown if you want more information https://en.cppreference.com/w/cpp/language/reference