Less warnings in lib

You may also specify that this method won’t handle strings with embedded null bytes (because you use the 1-argument constructor of `std::string`).