Refactoring libboostasio (part 2) #556
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR continues the factorization of the #550.
Note
This is the second child, the code is branched from #553 (first child), so this one accumulate the changes.
Each commit has been checked for regressions.
get_dispatch_wrapperfinally replaced with the newmake_handler,I tried to keep the changes to the bare minimum.
boost::bind(one of which was copied when passing parameters) plus one lambda. Now, all you need is a wrapper around a member pointer (std::mem_fn, which is then forwarded and not copied), astd::bind, and a lambda.std::functionis derived from the analogous boost (same forstd::bind), to avoid mixing std and boost I have replaced theboost::bindandboost::functionwith the equivalents from the standard library. This also helps with Support of ASIO standalone edition #381_read_pendingand_write_pendingflags. This issue will be automatically fixed along with Boost handler doesn't work with SSL #424 (already tested), the note serves as a warning.At this point the handler is just more robust and cleaner than before, from the next PRs I will start adding features and bug fixes.