[Bug libstdc++/101203] Remove unnecessary empty check in std::function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101203 Toni Neubert changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |WONTFIX --- Comment #5 from Toni Neubert --- Improvement not possible for all environment.
[Bug libstdc++/101203] Remove unnecessary empty check in std::function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101203 --- Comment #4 from Jonathan Wakely --- You can't use std::function at all in those environments.
[Bug libstdc++/101203] Remove unnecessary empty check in std::function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101203 --- Comment #3 from Toni Neubert --- Thank you Jonathan for your fast answer. To sad but the shared library issue seems valid. Can shared libraries exist is a freestanding environment (like a bare-metal microcontroller running without OS)? So there could maybe an optimization for some targets?
[Bug libstdc++/101203] Remove unnecessary empty check in std::function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101203 --- Comment #2 from Jonathan Wakely --- We also can't guarantee that the address of the new function is unique across shared libraries, making the test in _M_equal unreliable. The technique in std::any has a fallback to using RTTI.
[Bug libstdc++/101203] Remove unnecessary empty check in std::function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101203 --- Comment #1 from Jonathan Wakely --- PR 56551 uses a similar idea. It wouldn't be ABI compatible with existing code though.