A simple polyfill for std::move_only_function, to be used if C++23 features are not available. Note that it does not have all the features of std::move_only_function, only the minimum needed for the thread pool library.
More...
#include <BS_thread_pool.hpp>
|
|
std::unique_ptr< func_concept > | ptr = nullptr |
| |
template<typename R, typename... Args>
class BS::move_only_function< R(Args...)>
A simple polyfill for std::move_only_function, to be used if C++23 features are not available. Note that it does not have all the features of std::move_only_function, only the minimum needed for the thread pool library.
- Template Parameters
-
| R | The return type of the function. |
| Args | The argument types of the function. |
◆ move_only_function()
template<typename R , typename... Args>
template<typename F , typename = std::enable_if_t<!std::is_same_v<std::decay_t<F>, move_only_function> && std::is_invocable_r_v<R, F&, Args...>>>
323: ptr(std::make_unique<func_model<std::decay_t<F>>>(std::forward<F>(func))) {}
◆ operator()()
template<typename R , typename... Args>
326 {
327 return ptr->call(std::forward<Args>(args)...);
328 }
The documentation for this class was generated from the following file: