Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8
-
None
-
3
-
Foundation Sprint 105, Foundation Sprint 106, Foundation Sprint 107
Description
For now, there is only a single use of this macro. So there is no need to add it now. There may be more uses once we begin making more use of C++20.
Some changes and enhancements were made to the constexpr feature in C++20 making it more flexible. For example: It allows now dynamic memory allocation and deallocation, constexpr destructors, ect. https://en.cppreference.com/w/cpp/language/constexpr#:~:text=Constexpr%20lambda-,201907L,-(C%2B%2B20)}}
Create a macro for C++20 constexpr instead of writing multiple times:
#if __cpp_constexpr >= 201907L
constexpr
#endif
I suggest a simple macro CONSTEXPR_20 in qcompilerdetection.h:
#if __cpp_constexpr >= 201907L
define CONSTEXPR_20 constexpr
#else
define CONSTEXPR_20
#endif
Attachments
Issue Links
- blocks
-
QTBUG-120306 Modernize comparisons [Core: Smart Pointers]
- In Review
- is required for
-
QTBUG-125064 Wanted: a class QStringDataLiteral, for static strings needed as QString type
- Open
Gerrit Reviews
For Gerrit Dashboard: QTBUG-124462 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
555909,3 | qcompilerdetection.h: Introduce Q_DECL_CXX20_CONSTEXPR macro | dev | qt/qtbase | Status: NEW | -1 | 0 |
555982,1 | Document Q_DECL_CXX20_CONSTEXPR | dev | qt/qtbase | Status: ABANDONED | -1 | 0 |