Skip to content
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

std::function vs function pointer (was ::Non-portable: Converting a function pointer to an object pointer type or vice versa is conditionally-supported) #2

Open
aka-sps opened this issue Mar 18, 2018 · 1 comment

Comments

@aka-sps
Copy link

aka-sps commented Mar 18, 2018

INTERNATIONAL STANDARD ISO/IEC14882:2011(E) Third edition 2011-09-01

5.2.10 Reinterpret cast [expr.reinterpret.cast]

8 Converting a function pointer to an object pointer type or vice versa is conditionally-supported. The meaning of such a conversion is implementation-defined, except that if an implementation supports conversions in both directions, converting a prvalue of one type to the other type and back, possibly with different cv-qualification, shall yield the original pointer value.

@r35382 r35382 changed the title Non-portable: Converting a function pointer to an object pointer type or vice versa is conditionally-supported. std::function vs function pointer (was ::Non-portable: Converting a function pointer to an object pointer type or vice versa is conditionally-supported) Jul 9, 2018
@r35382
Copy link
Owner

r35382 commented Jul 9, 2018

Currently 'void*' variable is used for user`s callback storage. So, the above report is not exactly an issue.
However, usege of function pointers instead of modern std::function approach is the topic for discussions

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

No branches or pull requests

2 participants