Skip to content

callback - Remove problematic callback overloads #2869

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
Sep 30, 2016

Conversation

geky
Copy link
Contributor

@geky geky commented Sep 29, 2016

Note: This has no api changes, just removes an erronous set of overloads:

class Func {
public:
    operator()() {};
}

ticker.attach(Func());            // perfectly fine
ticker.attach(callback(Func());   // compile error

Unfortunately, it is very difficult to infer the parameters of function-objects generically in C++03 without any additional type information. The current implementation fails to do so, and the compiler simply bails with "unable to deduce template parameter".

Rather than leaving the user with a small novel of error messages, this patch removes the problematic callback overloads, leaving only callback overloads for the original pointer types.

Also updated the tests based on argument order.

related issue in mbed-events: ARMmbed/mbed-events#24
cc @pan-, @bogdanm, @bridadan

Unfortunately, it is very difficult to infer the parameters of
function-objects generically in C++03 without any additional type
information. The current implementation fails to do so, and the compiler
simply bails with "unable to deduce template parameter".

Rather than leaving the user with a small novel of error messages, this
patch removes the problematic callback overloads, leaving only callback
overloads for the original pointer types.
@geky
Copy link
Contributor Author

geky commented Sep 29, 2016

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1008

All builds and test passed!

@bogdanm bogdanm mentioned this pull request Sep 30, 2016
2 tasks
@geky
Copy link
Contributor Author

geky commented Sep 30, 2016

LGTM?

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll admit the C++ craziness is a bit beyond my understanding, but as a sanity check the changes look ok to me. No missing syntax or extra stuff hanging around that shouldn't be there 👍

@sg- sg- merged commit 7f8cada into ARMmbed:master Sep 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants