nghttpx: About implicit conversion from ImmutableString and std::string to StringRef
This is required to avoid creation of temporary ImmutableString like so: std::string x; ImmutableString y = ...; StringRef ref = !x.empty() ? x : y; First, temporary ImmutableString is created with x since ImmutableString has constructor to accept std::string. After StringRef gets this, the temporary ImmutableString is destroyed, and ref has dangling pointer.
Showing
Please register or sign in to comment