[wpimath,wpiutil] Switch std::is_constant_evaluated() to consteval (#9013)

Works around an ICE in the newest MSVC

gcem still uses the old method, at least for now
This commit is contained in:
Thad House
2026-06-28 16:53:44 -07:00
committed by GitHub
parent 329d214b90
commit 8b9351ffa0
14 changed files with 25 additions and 25 deletions

View File

@@ -24,7 +24,7 @@ constexpr double ceil_int(double x, double x_whole) noexcept {
}
constexpr double ceil(double x) noexcept {
if (std::is_constant_evaluated()) {
if consteval {
return ((x < 0.0 ? -x : x) >= 4503599627370496.
? x
: ceil_int(x, static_cast<double>(static_cast<int64_t>(x))));

View File

@@ -28,7 +28,7 @@ class SendableHelper {
__attribute__((no_sanitize("vptr")))
#endif
constexpr SendableHelper(SendableHelper&& rhs) {
if (!std::is_constant_evaluated()) {
if !consteval {
// it is safe to call Move() multiple times with the same rhs
SendableRegistry::Move(static_cast<Derived*>(this),
static_cast<Derived*>(&rhs));
@@ -40,7 +40,7 @@ class SendableHelper {
__attribute__((no_sanitize("vptr")))
#endif
constexpr SendableHelper& operator=(SendableHelper&& rhs) {
if (!std::is_constant_evaluated()) {
if !consteval {
// it is safe to call Move() multiple times with the same rhs
SendableRegistry::Move(static_cast<Derived*>(this),
static_cast<Derived*>(&rhs));
@@ -52,7 +52,7 @@ class SendableHelper {
constexpr SendableHelper() = default;
constexpr ~SendableHelper() {
if (!std::is_constant_evaluated()) {
if !consteval {
// it is safe to call Remove() multiple times with the same object
SendableRegistry::Remove(static_cast<Derived*>(this));
}