Skip to content

Could not construct fu2::unique_function from a pointer to member function on MSVC #71

Description

@Serikov

Compiling this example in MSVC v19.43 VS17.13 godbolt link gives an error:
more than one partial specialization matches the template argument list

Example code:

#include "function2/function2.hpp"
#include <functional>

struct Foo {
  std::size_t bar() const {
    return 5;
  }
};

int main() {
    std::function<std::size_t(const Foo&)> f(&Foo::bar); // compiles
    fu2::unique_function<std::size_t(const Foo&)> f2(&Foo::bar); // gives an error
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions