Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
random9e7de4c1
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
random9e7de4c1
5y ago
I agree with your point for small size data structures. But in general, and in the case of the OP source code, he doesn't even need to copy its arguments to pass them by value, he should pass them via a const reference, and just pass
2.
▲
by
random9e7de4c1
5y ago
Passing by value can be fine for small size structs, but it is not the common practice. I expected to see any of this function to use const reference. For general guidelines on parameters passing (and other guideilines), the C++ core guidel
3.
▲
by
random9e7de4c1
5y ago
I am curious to know why every single in function parameters in this project are passed by value. Too much RAM left unused in our modern desktops?