From: Daniel Arndt Date: Fri, 4 May 2018 16:36:22 +0000 (+0200) Subject: Restrict memset to trivial types in SparseMatrix X-Git-Tag: v9.0.0-rc1~13^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94f84e4a831478584caca3d0f1fe629e40efe81e;p=dealii.git Restrict memset to trivial types in SparseMatrix --- diff --git a/include/deal.II/lac/sparse_matrix.templates.h b/include/deal.II/lac/sparse_matrix.templates.h index 10832ee663..70c7fb191e 100644 --- a/include/deal.II/lac/sparse_matrix.templates.h +++ b/include/deal.II/lac/sparse_matrix.templates.h @@ -171,12 +171,22 @@ namespace internal typedef types::global_dof_index size_type; template - void zero_subrange (const size_type begin, - const size_type end, - T *dst) + typename std::enable_if::value>::type + zero_subrange (const size_type begin, + const size_type end, + T *dst) { std::memset (dst+begin,0,(end-begin)*sizeof(T)); } + + template + typename std::enable_if::value>::type + zero_subrange (const size_type begin, + const size_type end, + T *dst) + { + std::fill (dst+begin,dst+end,0); + } } }