39 using mapped_type =
typename M::mapped_type;
41 auto itr = map.find(key);
42 if constexpr (std::is_pointer_v<mapped_type>)
43 return itr != map.end() ? itr->second :
nullptr;
44 else if constexpr (
requires(mapped_type
const& p) { p.operator->(); })
47 if constexpr (std::is_copy_constructible_v<mapped_type>)
48 return itr != map.end() ? itr->second :
nullptr;
50 return itr != map.end() ? std::to_address(itr->second) :
nullptr;
53 return itr != map.end() ? std::addressof(itr->second) :
nullptr;