It does not, the problem demonstrated in the post is not applicable to c++ since the function should just accept an std::span(an array pointer+size, also can be implicitly converted to from std::array) and the problem would be gone.
It does not, the problem demonstrated in the post is not applicable to c++ since the function should just accept an std::span(an array pointer+size, also can be implicitly converted to from std::array) and the problem would be gone.
1) It's a new language that happens to be backwards-compatible with C.
2) It's C with a whole bunch of new features.
If you're using arrays or pointers instead of templates, you're doing (2). If your name isn't Linus Torvalds, you're not smart enough to do it safely.
1) It's a new language that happens to be backwards-compatible with C.
2) It's C with a whole bunch of new features.
If you're using arrays or pointers instead of templates, you're doing (2). If your name isn't Linus Torvalds, you're not smart enough to do it safely.