class executor
{
+ template<typename _Executor>
+ using _Context_t = decltype(std::declval<_Executor&>().context());
+
public:
// construct / copy / destroy:
executor(const executor&) noexcept = default;
executor(executor&&) noexcept = default;
- template<typename _Executor>
+ template<typename _Executor,
+ typename = _Require<is_lvalue_reference<_Context_t<_Executor>>>>
executor(_Executor __e)
: _M_target(make_shared<_Tgt1<_Executor>>(std::move(__e)))
{ }
- template<typename _Executor, typename _ProtoAlloc>
+ template<typename _Executor, typename _ProtoAlloc,
+ typename = _Require<is_lvalue_reference<_Context_t<_Executor>>>>
executor(allocator_arg_t, const _ProtoAlloc& __a, _Executor __e)
: _M_target(allocate_shared<_Tgt2<_Executor, _ProtoAlloc>>(__a,
std::move(__e), __a))