]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve formatting in base/data_out_base.cc 6815/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 21 Jun 2018 09:18:43 +0000 (11:18 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 21 Jun 2018 09:19:59 +0000 (11:19 +0200)
source/base/data_out_base.cc

index 855da02507b46bbe299ea12a94804448f6e96340..48c521b9f3540735e3007ef8d81b81b964510b73 100644 (file)
@@ -5465,20 +5465,16 @@ namespace DataOutBase
 
     const double nblocks = piece_names[0].size();
     Assert(nblocks > 0,
-           ExcMessage("piece_names should be a vector of nonempty vectors."))
+           ExcMessage("piece_names should be a vector of nonempty vectors."));
 
-        out
-      << "!NBLOCKS " << nblocks << '\n';
-    for (std::vector<std::vector<std::string>>::const_iterator domain =
-           piece_names.begin();
-         domain != piece_names.end();
-         ++domain)
+    out << "!NBLOCKS " << nblocks << '\n';
+    for (const auto &domain : piece_names)
       {
-        Assert(domain->size() == nblocks, ExcMessage("piece_names should be a vector of equal sized vectors.")) for (
-          std::vector<std::string>::const_iterator subdomain = domain->begin();
-          subdomain != domain->end();
-          ++subdomain) out
-          << *subdomain << '\n';
+        Assert(domain.size() == nblocks,
+               ExcMessage(
+                 "piece_names should be a vector of equal sized vectors."));
+        for (const auto &subdomain : domain)
+          out << subdomain << '\n';
       }
 
     out << std::flush;
@@ -5501,27 +5497,19 @@ namespace DataOutBase
     Assert(
       nblocks > 0,
       ExcMessage(
-        "time_and_piece_names should contain nonempty vectors of filenames for every timestep."))
+        "time_and_piece_names should contain nonempty vectors of filenames for every timestep."));
 
-        for (std::vector<std::pair<double, std::vector<std::string>>>::
-               const_iterator domain = times_and_piece_names.begin();
-             domain != times_and_piece_names.end();
-             ++domain) out
-      << "!TIME " << domain->first << '\n';
+    for (const auto &domain : times_and_piece_names)
+      out << "!TIME " << domain.first << '\n';
 
     out << "!NBLOCKS " << nblocks << '\n';
-    for (std::vector<
-           std::pair<double, std::vector<std::string>>>::const_iterator domain =
-           times_and_piece_names.begin();
-         domain != times_and_piece_names.end();
-         ++domain)
+    for (const auto &domain : times_and_piece_names)
       {
-        Assert(domain->second.size() == nblocks, ExcMessage("piece_names should be a vector of equal sized vectors.")) for (
-          std::vector<std::string>::const_iterator subdomain =
-            domain->second.begin();
-          subdomain != domain->second.end();
-          ++subdomain) out
-          << *subdomain << '\n';
+        Assert(domain.second.size() == nblocks,
+               ExcMessage(
+                 "piece_names should be a vector of equal sized vectors."));
+        for (const auto &subdomain : domain.second)
+          out << subdomain << '\n';
       }
 
     out << std::flush;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.