lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master adee8b8 1/7: Conditionalize all remaining use


From: Greg Chicares
Subject: [lmi-commits] [lmi] master adee8b8 1/7: Conditionalize all remaining use or inclusion of boost
Date: Wed, 6 Oct 2021 17:01:40 -0400 (EDT)

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

    Conditionalize all remaining use or inclusion of boost
    
    This prepares for the eradication of boost. See:
      https://lists.nongnu.org/archive/html/lmi/2021-10/msg00000.html
    
     * expression_template_0_test.cpp: Never define USE_UBLAS.
     * numeric_io_test.cpp: Guard boost use with a never-defined macro.
     * value_cast_test.cpp: Likewise.
---
 expression_template_0_test.cpp | 4 ----
 numeric_io_test.cpp            | 8 +++++++-
 value_cast_test.cpp            | 4 +++-
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/expression_template_0_test.cpp b/expression_template_0_test.cpp
index d98bdf6..7c3437b 100644
--- a/expression_template_0_test.cpp
+++ b/expression_template_0_test.cpp
@@ -21,10 +21,6 @@
 
 #include "pchfile.hpp"
 
-#if 202002L <= __cplusplus
-#   define USE_UBLAS
-#endif // 202002L < __cplusplus
-
 #if defined USE_UBLAS
 // BOOST !! Startlingly enough, boost uBLAS depends on this standard
 // macro. If it's not defined, then expression templates aren't used,
diff --git a/numeric_io_test.cpp b/numeric_io_test.cpp
index 4d577d2..d020db4 100644
--- a/numeric_io_test.cpp
+++ b/numeric_io_test.cpp
@@ -34,7 +34,9 @@
 #   pragma clang diagnostic ignored "-Wsometimes-uninitialized"
 #endif // defined LMI_CLANG
 
-#include <boost/lexical_cast.hpp>
+#if defined TEST_BOOST_IMPLEMENTATION_TOO
+#   include <boost/lexical_cast.hpp>
+#endif // defined TEST_BOOST_IMPLEMENTATION_TOO
 
 #if defined LMI_CLANG
 #   pragma clang diagnostic pop
@@ -97,12 +99,14 @@ void mete_two_thirds()
     stifle_warning_for_unused_value(d);
 }
 
+#if defined TEST_BOOST_IMPLEMENTATION_TOO
 void mete_two_thirds_boost()
 {
     std::string s = boost::lexical_cast<std::string>(2.0 / 3.0);
     double d = boost::lexical_cast<double>(s);
     stifle_warning_for_unused_value(d);
 }
+#endif // defined TEST_BOOST_IMPLEMENTATION_TOO
 
 void mete_infinity()
 {
@@ -194,7 +198,9 @@ int test_main(int, char*[])
     std::cout
         << "Conversions:"
         << "\n  2/3, lmi  : " << TimeAnAliquot(mete_two_thirds      )
+#if defined TEST_BOOST_IMPLEMENTATION_TOO
         << "\n  2/3, boost: " << TimeAnAliquot(mete_two_thirds_boost)
+#endif // defined TEST_BOOST_IMPLEMENTATION_TOO
         << "\n  inf, lmi  : " << TimeAnAliquot(mete_infinity        )
         << std::endl
         ;
diff --git a/value_cast_test.cpp b/value_cast_test.cpp
index c18ab4c..9329360 100644
--- a/value_cast_test.cpp
+++ b/value_cast_test.cpp
@@ -26,7 +26,9 @@
 #include "miscellany.hpp"
 #include "test_tools.hpp"
 
-#include <boost/lexical_cast.hpp>
+#if defined TEST_BOOST_IMPLEMENTATION_TOO
+#   include <boost/lexical_cast.hpp>
+#endif // defined TEST_BOOST_IMPLEMENTATION_TOO
 
 #include <cmath>                        // scalbn()
 #include <cstring>                      // strcpy(), strcmp()



reply via email to

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