Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit f8d2ccd3 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

Associative containers: use structure binding after they are introduced.

parent 7ca6b1e2
......@@ -177,9 +177,8 @@
" { \"Bob\", 22 }, \n",
" };\n",
" \n",
" for (const auto& pair : age_list)\n",
" std::cout << pair.first << \" : \" << pair.second << std::endl;\n",
" \n",
" for (const auto& [name, age] : age_list) // structure binding!\n",
" std::cout << name << \" : \" << age << std::endl;\n",
"}"
]
},
......@@ -212,8 +211,8 @@
" age_list.insert({\"Dave\", 44});\n",
" age_list.insert({\"Alice\", 32}); \n",
" \n",
" for (const auto& pair : age_list)\n",
" std::cout << pair.first << \" : \" << pair.second << std::endl;\n",
" for (const auto& [name, age] : age_list)\n",
" std::cout << name << \" : \" << age << std::endl;\n",
" \n",
"}"
]
......@@ -257,8 +256,8 @@
" std::cerr << \"Insertion of Alice failed\" << std::endl;\n",
"}\n",
"\n",
"for (const auto& pair : age_list)\n",
" std::cout << pair.first << \" : \" << pair.second << std::endl;\n",
"for (const auto& [name, age] : age_list)\n",
" std::cout << name << \" : \" << age << std::endl;\n",
"\n"
]
},
......@@ -357,8 +356,8 @@
" std::cout << \"Erin's age is \" << it->second << std::endl;\n",
" \n",
" \n",
" for (const auto& pair : age_list)\n",
" std::cout << pair.first << \" : \" << pair.second << std::endl;\n",
" for (const auto& [name, age] : age_list)\n",
" std::cout << name << \" : \" << age << std::endl;\n",
"}"
]
},
......@@ -504,5 +503,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment