From 94f84e4a831478584caca3d0f1fe629e40efe81e Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 4 May 2018 18:36:22 +0200 Subject: [PATCH] Restrict memset to trivial types in SparseMatrix --- include/deal.II/lac/sparse_matrix.templates.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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); + } } } -- 2.39.5