Re: [Development] How to make a fancy QMap c++17 initializer_list

2017-07-25 Thread Ville Voutilainen
On 26 July 2017 at 01:33, Thiago Macieira wrote: > On terça-feira, 25 de julho de 2017 15:03:17 PDT Marc Mutz wrote: >> A nested brace initializer does not have a type, if the types used in >> the inner braces are distinct, so >> >> std::map m = {{k1, v1}, {k2, v2}}; >> >> will not work, even

Re: [Development] How to make a fancy QMap c++17 initializer_list

2017-07-25 Thread Thiago Macieira
On terça-feira, 25 de julho de 2017 15:03:17 PDT Marc Mutz wrote: > A nested brace initializer does not have a type, if the types used in > the inner braces are distinct, so > > std::map m = {{k1, v1}, {k2, v2}}; > > will not work, even if the compiler implements the DR that you find > refere

Re: [Development] How to make a fancy QMap c++17 initializer_list

2017-07-25 Thread Marc Mutz
On 2017-07-25 10:10, Grégoire Barbier wrote: Le 24/07/2017 à 21:44, Henry Skoglund a écrit : 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

Re: [Development] How to make a fancy QMap c++17 initializer_list

2017-07-25 Thread Grégoire Barbier
Le 24/07/2017 à 21:44, Henry Skoglund a écrit : 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 m1 { {2, "score"}, {4, "seven"},

Re: [Development] How to make a fancy QMap c++17 initializer_list

2017-07-24 Thread Henry Skoglund
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 m1 { {2, "score"}, {4, "seven"}, }; Yes that works nicely too but it's not blee

Re: [Development] How to make a fancy QMap c++17 initializer_list

2017-07-24 Thread Grégoire Barbier
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 m1 { {2, "score"}, {4, "seven"}, }; -- Grégoire Barbier :: g à g76r.eu ___ Developm

Re: [Development] How to make a fancy QMap c++17 initializer_list

2017-07-24 Thread Henry Skoglund
On 2017-07-24 16:53, Thiago Macieira wrote: On Monday, 24 July 2017 00:00:36 PDT Marc Mutz wrote: Hi, We haven't added deduction guides to any Qt class, yet. If you want to use bleeding-edge C++, use C++, iow: std::map. std::map currently (GCC 7.1.1) works less well than QMap, since you can't

Re: [Development] How to make a fancy QMap c++17 initializer_list

2017-07-24 Thread Thiago Macieira
On Monday, 24 July 2017 00:00:36 PDT Marc Mutz wrote: > Hi, > > We haven't added deduction guides to any Qt class, yet. If you want to > use bleeding-edge C++, use C++, iow: std::map. std::map currently (GCC 7.1.1) works less well than QMap, since you can't even trick it. The std::pair that std:

Re: [Development] How to make a fancy QMap c++17 initializer_list

2017-07-24 Thread Henry Skoglund
Hi, I think there are almost no need for deduction guides, for example a similar program using QVector compiles fine on gcc-7: -- #include "qapplication.h" #include "qvector.h" #include "qdebug.h" int main(int argc, char *argv[]) {

Re: [Development] How to make a fancy QMap c++17 initializer_list

2017-07-24 Thread Marc Mutz
Hi, We haven't added deduction guides to any Qt class, yet. If you want to use bleeding-edge C++, use C++, iow: std::map. Patches welcome, bug reports accepted. Thanks, Marc On 2017-07-24 06:32, Henry Skoglund wrote: Hello, I've been testing more C++17 class template auto deduction awith gc

[Development] How to make a fancy QMap c++17 initializer_list

2017-07-23 Thread Henry Skoglund
Hello, I've been testing more C++17 class template auto deduction awith gcc-7, and got stuck on QMap, consider this simple test program: - #include "qapplication.h" #include "qmap.h" #include "qdebug.h" int main(int argc, char *argv[])