Use of C++2a in Qt 5.13
-
Hello Team,
Can I use C++20 draft features like range v3, format text etc. in Qt's latest version i.e. Qt 5.13? if yes then how?
-
Hello Team,
Can I use C++20 draft features like range v3, format text etc. in Qt's latest version i.e. Qt 5.13? if yes then how?
C++ standard features are compiler dependend. You would need to check with the compiler documentation, if it does already support this standard. As a next step if the compiler is already part of prebuilds, you may use with
CONFIG += <standard>
If it is not öpart of prebuilds you need to compile Qt libs on your own.
-
Oh I see,
I have checked for Qt 5.13 for mingw supported gcc version is 7.3.0 which supports c++17 for c++20, supported gcc version is >=8.0.So, I guess as you said I need to build qt libs by my own or need to wait proper Qt version in which gcc 8 will be integrated.
-
Oh I see,
I have checked for Qt 5.13 for mingw supported gcc version is 7.3.0 which supports c++17 for c++20, supported gcc version is >=8.0.So, I guess as you said I need to build qt libs by my own or need to wait proper Qt version in which gcc 8 will be integrated.
No need to wait for Qt to do any special integration work. gcc 8 and gcc 9 should build the current Qt just fine. It is usually a good idea to rebuild all libraries you are using (including Qt) when you switch to a new compiler, so that everything is consistent. It might work with the old binaries, but Qt Creator will likely give you a warning when you have a mismatch between the compiler version and the compiler that was used to build Qt.
-
Oh I see,
I have checked for Qt 5.13 for mingw supported gcc version is 7.3.0 which supports c++17 for c++20, supported gcc version is >=8.0.So, I guess as you said I need to build qt libs by my own or need to wait proper Qt version in which gcc 8 will be integrated.
@ankit-thakar If you just want to use these new C++ features in your own code then you don't have to wait for Qt to adapt or build Qt by yourself. Just activate the C++ standard you want to use like @koahnig wrote.