[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
- [lmi-commits] [lmi] master updated (19222f8 -> a111350), Greg Chicares, 2021/01/22
- [lmi-commits] [lmi] master bd30a5c 4/6: Change class cache_file_reads<>'s key type, Greg Chicares, 2021/01/22
- [lmi-commits] [lmi] master a111350 6/6: C++17ize, Greg Chicares, 2021/01/22
- [lmi-commits] [lmi] master b1d57e5 5/6: Establish another soon-to-become-useful invariant, Greg Chicares, 2021/01/22
- [lmi-commits] [lmi] master 84086c5 1/6: Note a spelling error in a literal quote, Greg Chicares, 2021/01/22
- [lmi-commits] [lmi] master 0fc4f3f 3/6: Correct a misapprehension,
Greg Chicares <=
- [lmi-commits] [lmi] master 8252fb3 2/6: Establish an invariant that will become useful ere long, Greg Chicares, 2021/01/22