Hacker News new | past | comments | ask | show | jobs | submit login

> This is why C++ code should use references more and pointers less. How's that working out in the era of move semantics?

Not terribly great. C++ references are neither move nor copy-assignable, which greatly limits their usefulness. For example, you can't use a reference as a loop counter. This means that references can never fully replace pointers: pointers are very natural loop counters when manipulating linked data structures.

What C++ needs is a movable, copyable, just non-nullable pointer type.

> Bjarne has said that "this" should have been a reference; making it a pointer was a mistake.

Wholeheartedly agree.




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

Search: