On 2017-07-24 21:32, Grégoire Barbier wrote:
Le 24/07/2017 à 18:45, Henry Skoglund a écrit :
QMap m1 = {std::pair{2,"score"}, {4,"seven"}, {1,"Four"},
{5,"years"}, {3,"and"}, {6,"ago"}};
Or even this:
QMap<int, const char*> m1 { {2, "score"}, {4, "seven"}, };
Yes that works nicely too but it's not bleeding edge/c++17 :-)
This post was just to show that in c++17 it's possible to declare a QMap
without any trailing <> i.e. letting the compiler figure out the types
(less visual clutter) More here:
http://en.cppreference.com/w/cpp/language/class_template_argument_deduction
Rgrds Henry
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development