在Asio中,overload_types call_free和adapter的概念是什么?

问题描述

代码的多个位置,Asio定义了以下枚举:

enum overload_type
{
  call_member,call_free,adapter,ill_formed
};

例如,考虑使用execution::execute,请参见https://github.com/chriskohlhoff/asio/blob/be7badc31abcc395cf868de6a1e240c2350bdbf2/asio/include/asio/execution/execute.hpp#L104-L110

我已经知道execution::execute充当CPO(Customization point object)。但是,我不明白的是:

  • 为什么call_free甚至存在?在STL中,我熟悉begin()之类的CPO。对于begin,您可以在与(ADL)调用的参数相同的名称空间中定义一个自由函数begin。 ADL使得std::begin重载requires是自由函数begin并执行它是多余的。因此,我不明白为什么在execution::execute的情况下有必要这么做?
  • 我仅找到execute个成员函数。我在Asio代码库中找不到任何免费的execute函数(也就是归类为call_free函数)。免费execute函数的示例是什么?
  • 什么是adapterstrand是适配器吗?还有适配器的其他示例吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)