| 337 | /// Specialization to work with addresses of callable objects |
| 338 | template <typename T, typename = void> |
| 339 | struct address_taker { |
| 340 | template <typename O> |
| 341 | static auto take(O&& obj) { |
| 342 | return std::addressof(obj); |
| 343 | } |
| 344 | static T& restore(void* ptr) { |
| 345 | return *static_cast<T*>(ptr); |
| 346 | } |
| 347 | static T const& restore(void const* ptr) { |
| 348 | return *static_cast<T const*>(ptr); |
| 349 | } |
| 350 | static T volatile& restore(void volatile* ptr) { |
| 351 | return *static_cast<T volatile*>(ptr); |
| 352 | } |
| 353 | static T const volatile& restore(void const volatile* ptr) { |
| 354 | return *static_cast<T const volatile*>(ptr); |
| 355 | } |
| 356 | }; |
| 357 | /// Specialization to work with addresses of raw function pointers |
| 358 | template <typename T> |
| 359 | struct address_taker<T, std::enable_if_t<std::is_pointer<T>::value>> { |
nothing calls this directly
no outgoing calls
no test coverage detected