]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use std::fill for std::vector<bool> 9841/head
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 6 Apr 2020 21:12:26 +0000 (17:12 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Mon, 6 Apr 2020 21:12:26 +0000 (17:12 -0400)
source/differentiation/ad/ad_helpers.cc

index 392fa59555b1afa033c3b4632222212ca671c30e..4d7fd6f79a5f1e4bbd76152a921feef1614e56a0 100644 (file)
@@ -81,9 +81,9 @@ namespace Differentiation
     HelperBase<ADNumberTypeCode,
                ScalarType>::reset_registered_independent_variables()
     {
-      for (auto &&registered_independent_variable_value :
-           registered_independent_variable_values)
-        registered_independent_variable_value = false;
+      std::fill(registered_independent_variable_values.begin(),
+                registered_independent_variable_values.end(),
+                false);
     }
 
 
@@ -93,9 +93,9 @@ namespace Differentiation
     HelperBase<ADNumberTypeCode, ScalarType>::
       reset_registered_dependent_variables(const bool flag)
     {
-      for (auto &&registered_marked_dependent_variable :
-           registered_marked_dependent_variables)
-        registered_marked_dependent_variable = flag;
+      std::fill(registered_marked_dependent_variables.begin(),
+                registered_marked_dependent_variables.end(),
+                flag);
     }
 
 

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.