Trying to create a Map in C++
06:28 07 Dec 2025

I am trying to create a map of stringstreams in C++

std::map myMap;
std::stringstream ss;
myMap.insert(std::pair(1, ss));

This fails to compile with

'': cannot convert from 'initializer list' to 'std::pair'

What does this mean and how can I resolve it?

c++ dictionary stdmap