Closed lucabaldini closed 8 years ago
Enabling C++11 in Qt is as easy as adding
QMAKE_CXXFLAGS += -std=c++11
in Qt 4 and
CONFIG += c++11
in Qt 5.
(See also issue #62.)
Needless to say, I wholeheartedly support this possibility.
See also issue #95
Edit,what it's really needed is apparently something along the lines of
equals(QT_MAJOR_VERSION, 4) {
QMAKE_CXXFLAGS += -std=c++11
QMAKE_CXXFLAGS_RELEASE -= -std=gnu++98
}
equals(QT_MAJOR_VERSION, 5) {
CONFIG += c++11
}
Everything switched to C++ 11. Closing this one.
This was first suggested by Alberto who wanted to use the
auto
syntax for vector iteration.I came across at least two other new C++11 functionalities that I'd like to use, namely scoped enums and default values for struct members.
Five years after the fact gcc has full support for C++11 and I'd propose to give it a try.