From: Wolfgang Bangerth <bangerth@math.tamu.edu> Date: Wed, 6 Apr 2016 21:07:49 +0000 (-0500) Subject: Avoid a warning. X-Git-Tag: v8.5.0-rc1~1134^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e81b414956255410c33b15112e5d57df4ad177;p=dealii.git Avoid a warning. This fixes a warning introduced in #2449. There, @drwells had asked me why I wrote for (std::size_t i=0; i!=N; ++i) when I could have written for (std::size_t i=0; i<N; ++i) I didn't remember and changed it to the latter, which did not warn on my laptop but does now on the compute server. The reason is that N is of type std::size_t, which turns out to be unsigned, and so warns if we happen to have N==0. This patch fixes the issue. --- diff --git a/include/deal.II/base/memory_consumption.h b/include/deal.II/base/memory_consumption.h index d59a50fd81..64b3a4e74f 100644 --- a/include/deal.II/base/memory_consumption.h +++ b/include/deal.II/base/memory_consumption.h @@ -352,7 +352,7 @@ namespace MemoryConsumption else { std::size_t mem = 0; - for (std::size_t i=0; i<N; ++i) + for (std::size_t i=0; i!=N; ++i) mem += memory_consumption(v[i]); return mem; }