From b39571781e4ce566de162cb187445b95b56cfd6f Mon Sep 17 00:00:00 2001 From: archshift Date: Mon, 2 Nov 2015 11:47:14 -0800 Subject: [PATCH] array_view: explicitly initialize constexpr function variables --- include/array_view.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/array_view.h b/include/array_view.h index 14d8888..69559f6 100644 --- a/include/array_view.h +++ b/include/array_view.h @@ -541,7 +541,7 @@ namespace details template 1), typename Ret = std::enable_if_t>> constexpr Ret shift_left(const index& other) noexcept { - Ret ret; + Ret ret{}; for (size_t i = 0; i < Rank - 1; ++i) { ret[i] = other[i + 1]; @@ -887,7 +887,7 @@ public: constexpr bounds_iterator& operator+=(difference_type n) noexcept { auto linear_idx = linearize(curr) + n; - std::remove_const_t stride; + std::remove_const_t stride = 0; stride[rank - 1] = 1; for (size_t i = rank - 1; i-- > 0;) {