Skip to content

support functors #42

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

Merged
merged 2 commits into from
Mar 26, 2016
Merged

support functors #42

merged 2 commits into from
Mar 26, 2016

Conversation

aminroosta
Copy link
Collaborator

Trying to fix #11 :-)

@Killili
Copy link
Collaborator

Killili commented Mar 26, 2016

The new test compiles and runs in VC2015.
I tried to get an understanding of the fault but i'm lost in the template jungle... i have the suspicion that there is a easier way but i might be totally wrong here. Shouldn't std::function in itself take care of the lambda/function/functor/member stuff?

But on the other hand this works, so you could pull this.

@aminroosta
Copy link
Collaborator Author

@Killili Thank you for testing on VS 👍
I was looking at function_traits the other day, and i saw that it specializes on operator() const member function, but user defined functors usually just have operator() without the const keywoard.

I tried specializing it without the const keyword and compiler seems to be picking the write specialization in case of both lambdas and functions.

@aminroosta aminroosta merged commit 709c4b5 into master Mar 26, 2016
@aminroosta aminroosta deleted the functors branch May 7, 2016 21:22
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

Successfully merging this pull request may close these issues.

How to use a functor to replace the lambda one?
2 participants