This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Frameworks policy for C++11 code

Tags: None
(comma "," separated)
User avatar
mykolak
Registered Member
Posts
8
Karma
0

Frameworks policy for C++11 code

Sun Sep 24, 2017 7:38 am
There are only several C++11 features freely available for Frameworks: https://community.kde.org/Frameworks/Po ... _C.2B.2B11
But according to paragraph above Frameworks Qt requirements current minimal Qt is Qt 5.7, which "requires C++11 support from the compiler, and has removed support from older compilers not providing adequate C++11 support."

Shouldn't C++11 available features be widened for Frameworks? What about range-based for loop? Since Qt 5.7 use of Q_FOREACH is discouraged. So shouldn't for ( : ) used where it possible to?
kde-cfeck
Registered Member
Posts
93
Karma
0
There is a semantic difference between for ( : ) and Q_FOREACH, so it cannot be blindly replaced.
User avatar
mykolak
Registered Member
Posts
8
Karma
0
Yes, I'm aware of their difference, though in most case it could be replaced but surely that must not be done blindly with sed.
I was not clear, I'm not about porting of existing code, but writing new one.
What C++11 features are accepted for new code? Current Frameworks/Policies doesn't allow for ( : ), while Q_FOREACH is already discouraged. I believe Frameworks/Policies should be updated and range-based for allowed among with other C++11 features, but maybe I'm wrong.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]