[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);
}
}
}
- [lmi-commits] [lmi] master updated (f9276c0 -> f0526be), Greg Chicares, 2021/06/02
- [lmi-commits] [lmi] master ad14033 6/8: Improve and test translation from ALGOL 60, Greg Chicares, 2021/06/02
- [lmi-commits] [lmi] master f0526be 8/8: Designate release candidate 20210602T1807Z, Greg Chicares, 2021/06/02
- [lmi-commits] [lmi] master 6b65f7f 3/8: Rename certain arguments and variables, Greg Chicares, 2021/06/02
- [lmi-commits] [lmi] master e41a14f 4/8: Improve instrumentation, Greg Chicares, 2021/06/02
- [lmi-commits] [lmi] master 7a75531 2/8: Write non-const reference arguments first,
Greg Chicares <=
- [lmi-commits] [lmi] master d0e0746 1/8: Improve documentation, Greg Chicares, 2021/06/02
- [lmi-commits] [lmi] master d35e677 7/8: Add a unit test: root of an unfriendly function, Greg Chicares, 2021/06/02
- [lmi-commits] [lmi] master 9292445 5/8: Fix a unit test, Greg Chicares, 2021/06/02