Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Rust is more than safety. Parent comment
That's just not accurate. This is UB, despite being done entirely using modern C++ API:
#include <iostream> #include <vector> using namespace std; int main() { std::vector<int> v; v.push_back(1); v.push_back(2); v.push_back(3); v.push_back(4); for (int i : v) { v.push_back(5); std::cout << i << std::endl; v.push_back(6); } return 0; }
1 8519872 3 4
There are no comments on this comment yet.
That's just not accurate. This is UB, despite being done entirely using modern C++ API:
I ran it on https://code.sololearn.com/caR4o14MOCWr/#cpp and got this output: