5 ms·
Like everything except "Ref returns and locals". I don't think I've ever seen a case where I wished for that feature. All the other things - tuples, anonymous
by statictype 10y ago
Like everything except "Ref returns and locals".
I don't think I've ever seen a case where I wished for that feature.
All the other things - tuples, anonymous out vars, pattern matching - I've found myself wanting quite often.
- taspeotis 10y agoI believe ref returns are a performance feature. They seem a bit like move constructors in C++ in that they can save you a copy? But I am not confident I understand the nuances of move constructors to compare them properly.
- johncolanduoni 10y agoThey don't move anything, they are either pointers to a value on the stack or to a field in an object on the heap. The first is more like how standard C++ references are usually used, and the second are interior pointers like Go has. No code gets executed to make them happen, and no data is copied.
- deleted 10y ago[deleted]