[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] C++ modernization
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] C++ modernization |
Date: |
Tue, 10 Jan 2017 14:44:42 +0100 |
On Tue, 10 Jan 2017 11:54:50 +0000 Greg Chicares <address@hidden> wrote:
GC> Moving on to pull/47...
GC>
GC> There's a problem with one file:
GC>
GC> | The only significant change was the removal of the default ctor of
GC> | database_impl in rate_table.cpp as it was confusing to have an empty ctor
GC> | which wasn't really equivalent to the default implementation due to the
use of
GC> | const member field. Clarify the intention by leaving only the ctor taking
a
GC> | path and calling it explicitly with an empty path when necessary.
GC>
GC> Running rate_table_test:
GC> Expect 'Possibly unknown field...':
GC> Possibly unknown field 'Bloordyblop' ignored at line 1.
GC>
GC> ** uncaught exception: std::exception: boost::filesystem::path: invalid
name ".ndx" in path: ".ndx"
GC>
GC> **** returning with error code 200
GC> ********** errors detected; see stdout for details ***********
GC> /opt/lmi/src/lmi/workhorse.make:1141: recipe for target
'rate_table_test.exe-run' failed
GC>
GC> I think I'd better ask you to resolve that.
You're probably even more tired of seeing my excuses than I'm of writing
them, but I've somehow forgot to finish this change (which is
understandable, to err is human and all that) and then somehow missed this
test failure (which is much less so :-(). So sorry again and please apply
the following patch to fix the code I broke:
---------------------------------- >8 --------------------------------------
diff --git a/rate_table.cpp b/rate_table.cpp
index 0106078..9bb9435 100644
--- a/rate_table.cpp
+++ b/rate_table.cpp
@@ -2476,6 +2476,13 @@ class database_impl
database_impl::database_impl(fs::path const& path)
:path_(path)
{
+ if(path_.empty())
+ {
+ // This ctor can be explicitly used with an empty path to create a
+ // database not (yet) associated with any physical file.
+ return;
+ }
+
fs::path const index_path = get_index_path(path);
fs::ifstream ifs(index_path, ios_in_binary());
if(!ifs) fatal_error() << "Unable to open '" << index_path << "'." <<
LMI_FLUSH;
---------------------------------- >8 --------------------------------------
Thanks in advance,
VZ
- Re: [lmi] [PATCH] Fix value_cast defect shown by the unit test, (continued)
- Re: [lmi] [PATCH] Fix value_cast defect shown by the unit test, Vadim Zeitlin, 2017/01/09
- [lmi] icedove anomaly, Greg Chicares, 2017/01/09
- [lmi] Replacing boost with std C++11 [Was: Fix value_cast defect shown by the unit test], Greg Chicares, 2017/01/09
- Re: [lmi] Replacing boost with std C++11 [Was: Fix value_cast defect shown by the unit test], Vadim Zeitlin, 2017/01/09
- [lmi] C++ modernization [Was: Replacing boost with std C++11], Greg Chicares, 2017/01/09
- Re: [lmi] C++ modernization [Was: Replacing boost with std C++11], Greg Chicares, 2017/01/10
- [lmi] Transient git resource unavailability [Was: C++ modernization], Greg Chicares, 2017/01/10
- Re: [lmi] C++ modernization, Vadim Zeitlin, 2017/01/10
- Re: [lmi] C++ modernization, Greg Chicares, 2017/01/10
- Re: [lmi] C++ modernization [Was: Replacing boost with std C++11], Greg Chicares, 2017/01/10
- Re: [lmi] C++ modernization,
Vadim Zeitlin <=
- Re: [lmi] C++ modernization, Greg Chicares, 2017/01/10
- Re: [lmi] C++ modernization, Vadim Zeitlin, 2017/01/11
- [lmi] static_assert and :argdo [Was: Replacing boost with std C++11], Greg Chicares, 2017/01/10
- Re: [lmi] static_assert and :argdo [Was: Replacing boost with std C++11], Vadim Zeitlin, 2017/01/10
- Re: [lmi] static_assert and :argdo [Was: Replacing boost with std C++11], Greg Chicares, 2017/01/11
- Re: [lmi] static_assert and :argdo [Was: Replacing boost with std C++11], Vadim Zeitlin, 2017/01/11
- Re: [lmi] static_assert and :argdo [Was: Replacing boost with std C++11], Greg Chicares, 2017/01/11
- Re: [lmi] Replacing boost with std C++11 [Was: Fix value_cast defect shown by the unit test], Greg Chicares, 2017/01/11
- Re: [lmi] Replacing boost with std C++11 [Was: Fix value_cast defect shown by the unit test], Greg Chicares, 2017/01/11
- Re: [lmi] Replacing boost with std C++11 [Was: Fix value_cast defect shown by the unit test], Vadim Zeitlin, 2017/01/11