Re: [committed] libstdc++: Make std::function work better with -fno-rtti

2020-11-09 Thread Jonathan Wakely via Gcc-patches
On 29/10/20 14:49 +, Jonathan Wakely wrote: This change allows std::function::target() to work even without RTTI, using the same approach as std::any. Because we know what the manager function would be for a given type, we can check if the stored pointer has the expected address. If it does,

Re: [committed] libstdc++: Make std::function work better with -fno-rtti

2020-10-29 Thread Jonathan Wakely via Gcc-patches
On 29/10/20 14:49 +, Jonathan Wakely wrote: This change allows std::function::target() to work even without RTTI, using the same approach as std::any. Because we know what the manager function would be for a given type, we can check if the stored pointer has the expected address. If it does,

[committed] libstdc++: Make std::function work better with -fno-rtti

2020-10-29 Thread Jonathan Wakely via Gcc-patches
This change allows std::function::target() to work even without RTTI, using the same approach as std::any. Because we know what the manager function would be for a given type, we can check if the stored pointer has the expected address. If it does, we don't need to use RTTI. If it isn't equal, we s

[committed] libstdc++: Make std::function work better with -fno-rtti

2020-10-29 Thread Jonathan Wakely via Gcc-patches
This change allows std::function::target() to work even without RTTI, using the same approach as std::any. Because we know what the manager function would be for a given type, we can check if the stored pointer has the expected address. If it does, we don't need to use RTTI. If it isn't equal, we s