lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 7a75531 2/8: Write non-const reference argume


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 7a75531 2/8: Write non-const reference arguments first
Date: Wed, 2 Jun 2021 15:37:06 -0400 (EDT)

branch: master
commit 7a75531097e5b45550b054917ae3fd657698af9b
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Write non-const reference arguments first
    
    While this might not be a universal style rule, here at least it's
    better to begin the argument-list with the arguments that the function
    modifies.
---
 zero.hpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/zero.hpp b/zero.hpp
index 149a74f..0add6a6 100644
--- a/zero.hpp
+++ b/zero.hpp
@@ -49,7 +49,7 @@ typedef std::pair<double,root_validity> root_type;
 
 namespace detail
 {
-inline void expatiate(int& n_iter, double x, double fx, std::ostream& os)
+inline void expatiate(int& n_iter, std::ostream& os, double x, double fx)
 {
     if(os.good())
         {
@@ -257,14 +257,14 @@ root_type decimal_root
     double b = round_(bound1);
 
     double fa = static_cast<double>(f(a));
-    detail::expatiate(number_of_iterations, a, fa, iteration_stream);
+    detail::expatiate(number_of_iterations, iteration_stream, a, fa);
     if(0.0 == fa) // Note 0.
         {
         return std::make_pair(a, root_is_valid);
         }
 
     double fb = static_cast<double>(f(b));
-    detail::expatiate(number_of_iterations, b, fb, iteration_stream);
+    detail::expatiate(number_of_iterations, iteration_stream, b, fb);
     if(0.0 == fb) // Note 0 [bis].
         {
         return std::make_pair(b, root_is_valid);
@@ -387,7 +387,7 @@ root_type decimal_root
         else
             {
             fb = static_cast<double>(f(b));
-            detail::expatiate(number_of_iterations, b, fb, iteration_stream);
+            detail::expatiate(number_of_iterations, iteration_stream, b, fb);
             }
         }
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]