From: Marc Fehling Date: Mon, 7 Jun 2021 20:07:12 +0000 (-0600) Subject: Add `constexpr` to type check. X-Git-Tag: v9.4.0-rc1~1260^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12406%2Fhead;p=dealii.git Add `constexpr` to type check. --- 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());