if constexpr
Issue #282
new
I was a bit surprised upon searching the complete Blaze repository of not finding any if constexpr
statements. Manyif
statements, however, could (depending on the compiler) benefit from usingif constexpr
statements instead, as this will force the compiler to elide the branch independent of optimization flags.
For example: SO
checks in Dense.h
.
Comments (4)
-
-
Hi Klaus,
Do you already have plans where exactly in blaze you are going to use
if constexpr
?Best regards
Thorsten
ps: Do you already have a rough release date in mind for 4.0?
-
Hi Thorsten!
- Everywhere.
if constexpr
will result in the largest refactoring that Blaze has ever experienced (and probably will ever experience). - There will be a Blaze 3.7 and perhaps a Blaze 3.8 (if necessary). After that we plan to release Blaze 4.0. Since we release approx. every half year, you can consider this a rough schedule.
Best regards,
Klaus!
- Everywhere.
-
Issue
#383was marked as a duplicate of this issue. - Log in to comment
Hi Matthias!
You are correct, Blaze does not use any
if constexpr
yet. The reason is that Blaze is a C++14 library throughout the 3.x releases (see also the “Compiler Compatibility” section on the main Blaze page) andif constexpr
is a C++17 feature. Usingif constexpr
would therefore be a breaking change. We will, however, move to C++17 with the 4.0 release and with that will be able to useif constexpr
.We will leave this issue open as a reminder. Thanks,
Best regards,
Klaus!