[mathic] 48/62: Changed ColumnPrinter::ratio overloads to be instead ratioInteger and ratioDouble. On gcc 4.6.3 there was an issue where almost all calls would en up being ambiguous in terms of which overload to use.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Wed Apr 1 11:36:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository mathic.

commit 002c905c5cf63533ed603484bce9550f10737434
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date:   Tue Feb 5 13:23:40 2013 +0100

    Changed ColumnPrinter::ratio overloads to be instead ratioInteger and ratioDouble. On gcc 4.6.3 there was an issue where almost all calls would en up being ambiguous in terms of which overload to use.
---
 src/mathic/ColumnPrinter.cpp | 8 ++++----
 src/mathic/ColumnPrinter.h   | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/mathic/ColumnPrinter.cpp b/src/mathic/ColumnPrinter.cpp
index c889883..90a3023 100755
--- a/src/mathic/ColumnPrinter.cpp
+++ b/src/mathic/ColumnPrinter.cpp
@@ -174,14 +174,14 @@ namespace mathic {
     const unsigned long long numerator,
     const unsigned long long denominator
   ) {
-    return ratio(numerator * 100, denominator) + '%';
+    return ratioInteger(numerator * 100, denominator) + '%';
   }
 
   std::string ColumnPrinter::percent(
     const double numerator,
     const double denominator
   ) {
-    return ratio(numerator * 100, denominator) + '%';
+    return ratioDouble(numerator * 100, denominator) + '%';
   }
 
   std::string ColumnPrinter::percentFixed(
@@ -201,7 +201,7 @@ namespace mathic {
     return oneDecimal(ratio * 100) + '%';
   }
 
-  std::string ColumnPrinter::ratio(
+  std::string ColumnPrinter::ratioInteger(
     const unsigned long long numerator,
     const unsigned long long denominator
   ) {
@@ -210,7 +210,7 @@ namespace mathic {
     return oneDecimal(static_cast<double>(numerator) / denominator);
   }
 
-  std::string ColumnPrinter::ratio(
+  std::string ColumnPrinter::ratioDouble(
     const double numerator,
     const double denominator
   ) {
diff --git a/src/mathic/ColumnPrinter.h b/src/mathic/ColumnPrinter.h
index 128c8e4..3c4419a 100755
--- a/src/mathic/ColumnPrinter.h
+++ b/src/mathic/ColumnPrinter.h
@@ -57,11 +57,11 @@ namespace mathic {
     static std::string percent(double ratio);
 
     /** Returns (7,4) as "1.8" */
-    static std::string ratio(
+    static std::string ratioInteger(
       unsigned long long numerator,
       unsigned long long denominator
     );
-    static std::string ratio(double numerator, double denominator);
+    static std::string ratioDouble(double numerator, double denominator);
 
 	/** Returns d as a string printed to 1 decimal place, rounding up at 0.5 */
     static std::string oneDecimal(double d);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathic.git



More information about the debian-science-commits mailing list