jeudi 30 mai 2019

std::map

The following crashes:

  std::map<std::string, int> m1{ {"0", 0}, { "1", 1 }};
  // auto melem = m1["0"]; // OK
  auto melem = m1[0];

Why is that?

Aucun commentaire:

Enregistrer un commentaire