Skip to content

Visual Studio 2017 fails to compiler async with std::function as argument #354

@FelixPetriconi

Description

@FelixPetriconi

stlab/concurrency/task.hpp(45): error C3546: '...': there are no parameter packs available to expand
stlab/concurrency/task.hpp(48): note: see reference to alias template instantiation 'stlab::v1::task<R(Args...>::possibly_empty_t' being compiled

Unfortunately I am not able to create a reduced example.

Solution is to change task.hpp to

static auto is_empty(const F& f){
  if constexpr (std::is_pointer<std::decay_t<F>>::value ||
    std::is_member_pointer<std::decay_t<F>>::value ||
    std::is_same<std::function<R(Args...)>, std::decay_t<F>>::value)
  {
    return !f;
  }
  else
  {
    return false;
  }
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions