Post #2584664
2026-02-01 04:33 UTC
I guess, if you come from garbage-collected languages, you might be used to not needing the ampersands, because everything is automatically a reference in those...
Replies (1)
-
@XPost3000@lemmy.ml 2026-02-01 04:48
Yeah this is how it was for me when I first started C++, I was use to any object beyond a simple 3D vector to always be passed by reference And then I read a C++ book my uncle gave me during a flight and realized that there isn't any syntax for passing a parameter by copy, so obviously that'd have to be the default behavior and I've been passing by reference ever since