From: Wolfgang Bangerth Date: Fri, 6 Oct 2017 13:56:04 +0000 (-0600) Subject: Simplify code. X-Git-Tag: v9.0.0-rc1~987^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db84180f29c0c9e5622bb51dc943dc2e3b2d786f;p=dealii.git Simplify code. --- diff --git a/include/deal.II/base/aligned_vector.h b/include/deal.II/base/aligned_vector.h index f1c46b56c5..2eca6eb434 100644 --- a/include/deal.II/base/aligned_vector.h +++ b/include/deal.II/base/aligned_vector.h @@ -581,26 +581,11 @@ namespace internal AlignedVectorDefaultInitialize (const std::size_t size, T *destination) : - destination_ (destination), - trivial_element (false) + destination_ (destination) { if (size == 0) return; - // do not use memcmp for long double because on some systems it does not - // completely fill its memory and may lead to false positives in - // e.g. valgrind - if (std::is_trivial::value == true && - std::is_same::value == false) - { - const unsigned char zero [sizeof(T)] = {}; - // cast element to (void*) to silence compiler warning for virtual - // classes (they will never arrive here because they are - // non-trivial). - T element {}; - if (std::memcmp(zero, (void *)&element, sizeof(T)) == 0) - trivial_element = true; - } if (size < minimum_parallel_grain_size) apply_to_subrange (0, size); else @@ -617,7 +602,7 @@ namespace internal // element to (void*) to silence compiler warning for virtual // classes (they will never arrive here because they are // non-trivial). - if (std::is_trivial::value == true && trivial_element) + if (std::is_trivial::value == true) std::memset ((void *)(destination_+begin), 0, (end-begin)*sizeof(T)); else default_construct_or_assign(begin, end, @@ -626,7 +611,6 @@ namespace internal private: mutable T *destination_; - bool trivial_element; // copy assignment operation void default_construct_or_assign(const std::size_t begin,