vendredi 2 avril 2021

extra comma while intializing map object

Being a strict type checking language, how c++ allows the extra comma after initialization of elements inside the map object is over. Is there any special meaning behind this?

Complete example can be seen here on cppreference.com

// Create a map of three strings (that map to integers)
std::map<std::string, int> m { {"CPU", 10}, {"GPU", 15}, {"RAM", 20}, };

enter image description here

Aucun commentaire:

Enregistrer un commentaire