Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get asprintf to work with string_view in the args list
Based on a question over in Zitrax's gist: (https://gist.github.com/Zitrax/a2e0040d301bf4b8ef8101c0b1e3f1d5), we use static_cast, combined with std::move and std::forward in unistd::asprintf_convert to get unistd::asprintf to work with std::string_view in the argument list. There are two other variations on the return line that also work, but I chose std::forward to keep things the same. I also wonder if this might not introduce a memory leak?
- Loading branch information