]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add `constexpr` to type check. 12406/head
authorMarc Fehling <mafehling.git@gmail.com>
Mon, 7 Jun 2021 20:07:12 +0000 (14:07 -0600)
committerMarc Fehling <mafehling.git@gmail.com>
Tue, 8 Jun 2021 00:06:39 +0000 (18:06 -0600)
include/deal.II/base/utilities.h

index 2d3b81b6f0013f4714a7fdc5aa69d33bbe0681c3..0643eec0c26ff26fb1f6499b78a970433c3c75fc 100644 (file)
@@ -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<T>() && sizeof(T) * N < 256)
+#else
     if (std::is_trivially_copyable<T>() && sizeof(T) * N < 256)
+#endif
       {
         Assert(std::distance(cbegin, cend) == sizeof(T) * N,
                ExcInternalError());

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.