logoalt Hacker News

breuwitoday at 3:53 AM2 repliesview on HN

[Deleted, misread]


Replies

Matheus28today at 3:59 AM

Since C++11, data() is also required to be null terminated. Per your own source and cppreference.

show 1 reply
beached_whaletoday at 4:07 AM

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