From 51f3739e46c277c6d6d1bef8cfdfe81fbbe4bfa4 Mon Sep 17 00:00:00 2001 From: Andy Little Date: Thu, 14 May 2020 17:27:49 +0100 Subject: [PATCH] example linear_algebra : change deduced type of iterator index to unsigned type --- example/linear_algebra.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/example/linear_algebra.cpp b/example/linear_algebra.cpp index 13a4ffc3..749fc65d 100644 --- a/example/linear_algebra.cpp +++ b/example/linear_algebra.cpp @@ -33,7 +33,7 @@ template std::ostream& operator<<(std::ostream& os, const std::math::vector& v) { os << "|"; - for (auto i = 0; i < v.size(); ++i) { + for (auto i = 0U; i < v.size(); ++i) { os << fmt::format(" {:>9}", v(i)); } os << " |"; @@ -43,12 +43,12 @@ std::ostream& operator<<(std::ostream& os, const std::math::vector& v) template std::ostream& operator<<(std::ostream& os, const std::math::matrix& v) { - for (auto i = 0; i < v.rows(); ++i) { + for (auto i = 0U; i < v.rows(); ++i) { os << "|"; - for (auto j = 0; j < v.columns(); ++j) { + for (auto j = 0U; j < v.columns(); ++j) { os << fmt::format(" {:>9}", v(i, j)); } - os << (i != v.rows() - 1 ? " |\n" : " |"); + os << (i != v.rows() - 1U ? " |\n" : " |"); } return os; }