mardi 18 avril 2023

no matching constructor for initialization of 'std::map

i am trying to initialize the following map in c++11

#include <map>
std::map<char, const char []> nomi = {
    { (char) 0, "Oggetto" },
    { (char) 1, "Entity" },
    { (char) 2, "Player" },
    { (char) 3, "Proiettile" },
    { (char) 4, "SaltoInAlto" },
    { (char) 5, "SuperVelocita" },
    { (char) 6, "Volo" },
    { (char) 7, "Pavimento" }
};

if i use previous versions i get different errors since i can't initialize this way a map... so i am using -std=c++11

Aucun commentaire:

Enregistrer un commentaire