Merge pull request #163 from archshift/patch-1

array_view: explicitly initialize constexpr function variables
This commit is contained in:
Neil MacIntosh 2015-11-02 11:53:08 -08:00
commit ba3126105b

View File

@ -541,7 +541,7 @@ namespace details
template <size_t Rank, typename ValueType, bool Enabled = (Rank > 1), typename Ret = std::enable_if_t<Enabled, index<Rank - 1, ValueType>>>
constexpr Ret shift_left(const index<Rank, ValueType>& 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<value_type> stride;
std::remove_const_t<value_type> stride = 0;
stride[rank - 1] = 1;
for (size_t i = rank - 1; i-- > 0;)
{