Hacker Newsnew | past | comments | ask | show | jobs | submit | lkjjfowjflasdf's commentslogin


> Do pass expensive types by const reference.

Consider `foo(T t)` where `foo` takes ownership of `T` and allows move semantics, but there is risk of copy if `t` is not an r-value reference.


It's very rare where doing that is a good idea. A constructor is about the only time when you get much of a benefit.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: