From 5749d7383464f06c9b81e106ccc7c0f1b140ff40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 11 Jun 2025 13:56:32 +0200 Subject: [PATCH] Math: don't use std::is_trivial that's deprecated in C++26. It was such a nice short name, but alas. Useful details about why are at https://stackoverflow.com/questions/79222674/why-is-stdis-trivial-deprecated-in-c26 Unfortunately while the old GCC 4.8 had std::is_trivial, it doesn't have std::is_trivially_constructible, which means more nasty branching in certain places. --- src/Magnum/Math/Dual.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Magnum/Math/Dual.h b/src/Magnum/Math/Dual.h index f660c4d5d..f633c3006 100644 --- a/src/Magnum/Math/Dual.h +++ b/src/Magnum/Math/Dual.h @@ -81,7 +81,13 @@ template class Dual { #ifdef DOXYGEN_GENERATING_OUTPUT constexpr explicit Dual(ZeroInitT) noexcept; #else - template::value && std::is_trivial::value, int>::type = 0> constexpr explicit Dual(ZeroInitT) noexcept: _real{}, _dual{} {} + template::value && std::has_trivial_default_constructor::value + #else + std::is_standard_layout::value && std::is_trivially_constructible::value + #endif + , int>::type = 0> constexpr explicit Dual(ZeroInitT) noexcept: _real{}, _dual{} {} template::value, int>::type = 0> constexpr explicit Dual(ZeroInitT) noexcept: _real{ZeroInit}, _dual{ZeroInit} {} #endif @@ -90,7 +96,13 @@ template class Dual { #ifdef DOXYGEN_GENERATING_OUTPUT explicit Dual(NoInitT) noexcept; #else - template::value && std::is_trivial::value, int>::type = 0> explicit Dual(Magnum::NoInitT) noexcept {} + template::value && std::has_trivial_default_constructor::value + #else + std::is_standard_layout::value && std::is_trivially_constructible::value + #endif + , int>::type = 0> explicit Dual(Magnum::NoInitT) noexcept {} template::value, int>::type = 0> explicit Dual(Magnum::NoInitT) noexcept: _real{Magnum::NoInit}, _dual{Magnum::NoInit} {} #endif