From c4d1ff30af1d41c9b1814011aee8d6bf08b67f64 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Mon, 7 Jun 2021 14:07:12 -0600 Subject: [PATCH] Add `constexpr` to type check. --- include/deal.II/base/utilities.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index 2d3b81b6f0..0643eec0c2 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -1334,7 +1334,11 @@ namespace Utilities // see if the object is small and copyable via memcpy. if so, use // this fast path. otherwise, we have to go through the BOOST // serialization machinery +#ifdef DEAL_II_HAVE_CXX17 + if constexpr (std::is_trivially_copyable() && sizeof(T) * N < 256) +#else if (std::is_trivially_copyable() && sizeof(T) * N < 256) +#endif { Assert(std::distance(cbegin, cend) == sizeof(T) * N, ExcInternalError()); -- 2.39.5