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

Should int(*)() be convertible to inplace_function<void()>? #159

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on May 23, 2019

  1. Should int(*)() be convertible to inplace_function<void()>?

    Before this patch, we reported that `is_convertible<int(*)(), inplace_function<void()>>`,
    but if you actually tried to do it, you got a compiler error down in the guts
    of `inplace_function`.
    
    After this patch, we let you do it.
    
    However, see issue WG21-SG14#150: I think anyone who relies on this behavior is probably
    doing so unintentionally (and their code is probably wrong). Therefore, maybe we
    should change our SFINAE so that `is_convertible<int(*)(), inplace_function<void()>>`
    would be `false`.
    Quuxplusone committed May 23, 2019
    Configuration menu
    Copy the full SHA
    50c3b31 View commit details
    Browse the repository at this point in the history
  2. inplace_function: is_convertible<int(), inplace_function<void()>>.

    Put the "standard" behavior under a macro flag, and default to
    the "safer" behavior. That is, disallow the conversion by default.
    Quuxplusone committed May 23, 2019
    Configuration menu
    Copy the full SHA
    191f893 View commit details
    Browse the repository at this point in the history