Details
-
Task
-
Resolution: Fixed
-
P2: Important
-
None
-
6.8
-
None
-
21
-
3ab18f402 (dev), 8fa8c574c (dev)
-
Foundation Sprint 105, Foundation Sprint 106, Foundation Sprint 107, Foundation Sprint 108, Foundation Sprint 109, Foundation Sprint 110, Foundation Sprint 111, Foundation Sprint 112, Foundation Sprint 113, Foundation Sprint 114, Foundation Sprint 115, Foundation Sprint 116
Description
Update: For now, there is only one single use of this macro: explicit destructors can be constexpr. There may be more once we increase our usage of C++20. Therefore, there is no need to add it now. Instead we are adding Q_DECL_CONSTEXPR_DTOR.
_____________________________________________________________________________________
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 explicit 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
- is required for
-
QTBUG-125064 Wanted: a class QStringDataLiteral, for static strings needed as QString type
-
- Open
-
- mentioned in
-
Page Loading...