asio C++ library

PrevUpHomeNext

strand::prefer

Forward a preference to the underlying executor.

template<
    typename Property>
constraint< can_prefer< const Executor &, Property >::value &&!is_convertible< Property, execution::blocking_t::always_t >::value, strand< typename decay< typename prefer_result< const Executor &, Property >::type >::type > >::type prefer(
    const Property & p) const;

Do not call this function directly. It is intended for use with the prefer customisation point.

For example:

asio::strand<my_executor_type> ex1 = ...;
auto ex2 = asio::prefer(ex1,
    asio::execution::blocking.never);

PrevUpHomeNext