lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 957ead4 2/3: Improve physical design


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 957ead4 2/3: Improve physical design
Date: Sat, 4 Apr 2020 10:08:29 -0400 (EDT)

branch: master
commit 957ead4651ce312a744f36eb4742194fda20d786
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Improve physical design
    
    Moved implementation of operator<<() out of line so that class header
    doesn't need to include <ostream>. See:
      https://lists.nongnu.org/archive/html/lmi/2020-04/msg00001.html
---
 rate_table.cpp | 7 ++++++-
 rate_table.hpp | 8 +-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/rate_table.cpp b/rate_table.cpp
index 580c397..90ec1de 100644
--- a/rate_table.cpp
+++ b/rate_table.cpp
@@ -43,7 +43,6 @@
 #include <istream>
 #include <limits>
 #include <map>
-#include <memory>
 #include <optional>
 #include <ostream>
 #include <sstream>
@@ -3168,6 +3167,12 @@ void database::save(std::ostream& index_os, 
std::ostream& data_os)
         }
 }
 
+std::ostream& operator<<(std::ostream& os, table::Number const& number)
+{
+    os << number.value();
+    return os;
+}
+
 } // namespace soa_v3_format
 
 /// Infer the decimal precision of a rounded decimal-formatted number.
diff --git a/rate_table.hpp b/rate_table.hpp
index a90d18f..b8889b2 100644
--- a/rate_table.hpp
+++ b/rate_table.hpp
@@ -30,7 +30,6 @@
 #include <cstdint>
 #include <iosfwd>
 #include <memory>                       // shared_ptr
-#include <ostream>
 #include <string>
 #include <vector>
 
@@ -187,12 +186,7 @@ class database final
     database_impl* const impl_;
 };
 
-inline std::ostream& operator<<(std::ostream& os, table::Number const& number)
-{
-    os << number.value();
-
-    return os;
-}
+std::ostream& operator<<(std::ostream&, table::Number const&);
 
 } // namespace soa_v3_format
 



reply via email to

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