3 ms·
Can you elaborate?
by Sir_Cmpwn 8y ago
Can you elaborate?
- TheCycoONE 8y agoNot the original poster, but in C++ you would be using a container, likely a vector so the internal data could move, but because the container is updated the caller can be unaware. The abstraction leaks a bit. The result of a data() or c_str() call cannot be trusted after the vector is manipulated. When passing a vector by reference to another function you effectively get a double pointer (abstracted behind a reference and a container) so the inner one can be moved. I'm not familiar with go, but if it is like C in this respect append would have been clearer with a double pointer and no return value.