mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
[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:
@@ -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))));
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user