another case where this would be useful ))

ср, 27 июл. 2022 г. в 22:40, Emile Cormier via Std-Proposals <>:
(Cross-posted to

In the upcoming C++ networking proposal, we need a wrapper that type-erases an asynchronous handler and bundles its associated executor and allocator. This would prevent the forcing of higher-level networking libraries to be header-only. It would also allow such higher-level networking libraries to expose known types in its API, instead of templatized function arguments.

This proposed type-erased handler could be passed to asio::post and the like. It would also have to support underlying handlers that are move-only.

Some of us still care about compile times and being able to apply the Pimpl idiom. This is not possible when our libraries are forced to be header-only because of Asio wanting everything to be a template.

I have found such a wrapper in the wild at . However it lacks small buffer optimization and has additional stuff that seems specific to that library.

Emile Cormier
Std-Proposals mailing list