Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
FelixPetriconi opened this issue Feb 1, 2021 · 1 comment
Assignees

Comments

@FelixPetriconi
Copy link
Member

FelixPetriconi commented Feb 1, 2021

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;
  }
}
@FelixPetriconi FelixPetriconi self-assigned this Feb 1, 2021
FelixPetriconi added a commit to FelixPetriconi/libraries that referenced this issue Feb 1, 2021
@FelixPetriconi
Copy link
Member Author

Fixed in 1.5.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant