]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use non-reference type for copied RBL element 11088/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 22 Oct 2020 20:27:34 +0000 (22:27 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 22 Oct 2020 21:02:29 +0000 (23:02 +0200)
include/deal.II/base/patterns.h

index a68a374a9d86247424b1f07c60774e096d5acdbc..e545a556c0c11de9f184ad0a5b73a28319cbae9e 100644 (file)
@@ -1792,9 +1792,10 @@ namespace Patterns
         auto                     base_p = p->get_base_pattern().clone();
         std::vector<std::string> vec(t.size());
 
-        unsigned int i = 0;
-        for (const auto &entry : t)
-          vec[i++] = Convert<typename T::value_type>::to_string(entry, base_p);
+        std::transform(
+          t.cbegin(), t.cend(), vec.begin(), [&base_p](const auto &entry) {
+            return Convert<typename T::value_type>::to_string(entry, base_p);
+          });
 
         std::string s;
         if (vec.size() > 0)

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.