lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 0fc4f3f 3/6: Correct a misapprehension


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0fc4f3f 3/6: Correct a misapprehension
Date: Fri, 22 Jan 2021 21:55:54 -0500 (EST)

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

    Correct a misapprehension
    
    cache_file_reads<X> does not require that X be default-constructible.
---
 cache_file_reads.hpp      | 2 +-
 cache_file_reads_test.cpp | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/cache_file_reads.hpp b/cache_file_reads.hpp
index e69892e..930bcde 100644
--- a/cache_file_reads.hpp
+++ b/cache_file_reads.hpp
@@ -41,7 +41,7 @@ namespace detail
 /// Motivation: It is costly to deserialize objects from xml, so cache
 /// them for reuse. The cache persists until the program terminates.
 ///
-/// Requires: T::T() and T::T(std::string const& filename).
+/// Requires: T::T(std::string const& filename), though not T::T().
 ///
 /// For each filename, the cache stores one instance, which is
 /// replaced by reloading the file if its write time has changed.
diff --git a/cache_file_reads_test.cpp b/cache_file_reads_test.cpp
index f737d14..16283a2 100644
--- a/cache_file_reads_test.cpp
+++ b/cache_file_reads_test.cpp
@@ -36,7 +36,6 @@ class X
     :public cache_file_reads<X>
 {
   public:
-    X() = default;
     X(std::string const& filename)
         {
         std::ifstream ifs(filename, ios_in_binary());
@@ -71,9 +70,8 @@ class cache_file_reads_test
 
 void cache_file_reads_test::test_preconditions()
 {
-    // X() and X(filename) are required.
-    X x0;
-    X x1("sample.ill");
+    // X(filename) is required.
+    X x0("sample.ill");;
 
     // The cache is accessible with or without an object.
     BOOST_TEST_EQUAL



reply via email to

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