Skip to content

Is it possible to overload the call operator? #4047

Closed Answered by csyonghe
Cazadorro asked this question in Q&A
Discussion options

You must be logged in to vote

This is now supported, closing now.

struct MyFunctor
{
       int operator()(float v) { ... }
}

void test()
{
    let f = MyFunctor();
    f(2.0f);
}

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@csyonghe
Comment options

Comment options

You must be logged in to vote
2 replies
@natevm
Comment options

@Cazadorro
Comment options

Answer selected by Cazadorro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants