We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
struct Foo { Foo(int num) : num_(num) {} void print_add(int i) const { std::cout << num_+i << '\n'; } int num_; }; const Foo foo1(1); // fu2::function<int(const Foo&)> fn3 = &Foo::num_; // report fail here std::function<int(const Foo&)> stdfn3 = &Foo::num_; std::cout << stdfn3(2) << std::endl; std::cout << stdfn3(foo1) << std::endl;
error: conversion from 'int Foo::*' to non-scalar type.... gcc version 6.3.0 (GCC)
but it worked with std::bind
fu2::function<int(const Foo&)> fn5 = std::bind(&Foo::num_, _1); // this is ok cout << fn5(foo1) << endl;
The text was updated successfully, but these errors were encountered:
Implement wrapping of scalar class members
fae599c
* Closes #10
1e53630
Thanks for your report. I added the capability to work with class member pointers so this is aligned to std::function.
Sorry, something went wrong.
No branches or pull requests
error: conversion from 'int Foo::*' to non-scalar type....
gcc version 6.3.0 (GCC)
but it worked with std::bind
The text was updated successfully, but these errors were encountered: