Re:Sentinels Can Be Faster
by saagarjha on Wednesday September 09, 2020 @08:06PM
(#24427465)
Generally my policy with std::string and NULs is "don't, ever" because someone is going to call c_str() on it and pass it to a C API, and bad things are going to happen. If you need to embed \0, then use std::vector<char>. Of course, you do get the slight benefit that in the cases where you don't call C APIs you won't have bad things happen, but I wouldn't could on that.
[ Parent
| on HN ]