79473107

Date: 2025-02-27 15:15:02
Score: 0.5
Natty:
Report link

I could solve this with following change:

#include <type_traits>
#include <string>
#include <map>

struct MapRegistration
{
    template <typename MapT, typename KeyType, typename ValueType>
    static void from(ValueType& (MapT::*insertMethod)(const KeyType&))
    {
    }
};

int main()
{
    using MapType = std::map<std::string, double>;
    MapRegistration::from<MapType, std::string, double>(&MapType::operator[]);
    return 0;
}
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Stefano