-
Notifications
You must be signed in to change notification settings - Fork 761
C++17 string_view #213
Comments
Brilliant! Would you mind creating a pull request so that you get credited for this:)? |
Lol, sure, I'll do it for the fame and fortune! |
@eidheim Can't seem to push my PR. Getting permission denied. |
@SethHamilton You need to fork this repository on your account, then you push your changes there. Then you can create a Pull Request to eidheim's repo. |
I've made the PR here: #214 This is failing CI, but I think it's because it's not set to the C++17 standard for compilation. |
@pboettch @eidheim Ok, so, there is a (stupid) flaw with The alternative would be to use the |
like perhaps something like this:
I'm starting to lean toward something like |
This is compiling. I've added two tests with the |
Simple-Web-Server/client_http.hpp
Line 19 in 1056bd2
I changed this line to:
and life became wonderful. My application keeps data in
char*
format (with a knownsize_t
). I was pushing thesechar*
buffers into streams, and passing them torequest
. I realized that this results in 2 copies of the data (one to create my stream, and anotherrequest
uses<<
to push that stream into ASIO).string_view
solves this wonderfully, as it simply wraps the pointer and length, and results in one less copy (some of my transfers are over 100mb, making copies painful and memory intensive).I realize your original code comment might have to do with C++17 feature detection, but I think this can be cured with the following:
Super-ultra-nice would be versions of request that took a
char*
and asize_t
, I could see this being a super common use case.The text was updated successfully, but these errors were encountered: