Hacker News new | ask | show | jobs
by breuwi 74 days ago
[Deleted, misread]
2 comments

Since C++11, data() is also required to be null terminated. Per your own source and cppreference.
LOL, I need to learn to click on the more modern tabs. Will delete comment.
std::string since C++ 11 guarantees the buffer is zero terminated. The reasoning being thread safety of const members. https://eel.is/c++draft/basic.string#general-3