From d856989513cafc9bb2292cbffc3a109c530de7de Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Sat, 3 Nov 2018 21:15:05 -0600 Subject: [PATCH] warnings: Compiler warning on memset usage for non-trivial type Problem: - IS_TRIVIALLY_CONSTRUCTIBLE macro does not work correctly resulting in `memset()` usage to set a non-trivial type to 0 when `nontrivial_t` is passed in from the tests. - Warning reported by GCC when compiling with `--enable-werror`. Solution: - Use the standard algorithm `std::fill_n()` and let the compiler determine the optimal way of looping or using `memset()`. --- src/prevector.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/prevector.h b/src/prevector.h index a02afd37a7f04..f3294870b46fe 100644 --- a/src/prevector.h +++ b/src/prevector.h @@ -10,6 +10,8 @@ #include #include +#include +#include #include #include