[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 4d87259 3/6: Create and use a proper alias
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 4d87259 3/6: Create and use a proper alias |
Date: |
Fri, 19 Oct 2018 15:45:06 -0400 (EDT) |
branch: master
commit 4d872593f550a5cdc4f62cdeaa6dcfdd7a0c27cf
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Create and use a proper alias
See the preceding commit message. After
smart_pointer p(values);
p->do_something();
container.push_back(p);
it was improper to continue using p as an alias for container.back(),
even though that happened to work for std::shared_ptr.
---
group_values.cpp | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/group_values.cpp b/group_values.cpp
index 2e44cff..d7014f7 100644
--- a/group_values.cpp
+++ b/group_values.cpp
@@ -267,24 +267,25 @@ census_run_result run_census_in_parallel::operator()
{
{ // Begin fenv_guard scope.
fenv_guard fg;
- std::shared_ptr<AccountValue> av(new AccountValue(ip));
- cell_values.push_back(av);
+ std::shared_ptr<AccountValue> z(new AccountValue(ip));
+ cell_values.push_back(z);
+ AccountValue& av = *cell_values.back();
std::string const name(cells[j]["InsuredName"].str());
// Indexing: here, j is an index into cells, not cell_values.
- av->SetDebugFilename
+ av.SetDebugFilename
(serial_file_path(file, name, j, "hastur").string()
);
- if(contains(av->yare_input_.Comments, "idiosyncrasyZ"))
+ if(contains(av.yare_input_.Comments, "idiosyncrasyZ"))
{
- av->Debugging = true;
- av->DebugPrintInit();
+ av.Debugging = true;
+ av.DebugPrintInit();
}
if
- ( first_cell_inforce_year != av->yare_input_.InforceYear
- || first_cell_inforce_month != av->yare_input_.InforceMonth
+ ( first_cell_inforce_year != av.yare_input_.InforceYear
+ || first_cell_inforce_month != av.yare_input_.InforceMonth
)
{
alarum()
@@ -294,7 +295,7 @@ census_run_result run_census_in_parallel::operator()
;
}
- if(mce_solve_none != av->yare_input_.SolveType)
+ if(mce_solve_none != av.yare_input_.SolveType)
{
alarum()
<< "Running census by month: solves not permitted."
- [lmi-commits] [lmi] master updated (4c21bf7 -> 2ba6003), Greg Chicares, 2018/10/19
- [lmi-commits] [lmi] master 8eead43 4/6: Don't write 'new', Greg Chicares, 2018/10/19
- [lmi-commits] [lmi] master 4d87259 3/6: Create and use a proper alias,
Greg Chicares <=
- [lmi-commits] [lmi] master d2b8c01 1/6: Improve physical design: unique_ptr member --> out-of-line ~owner(), Greg Chicares, 2018/10/19
- [lmi-commits] [lmi] master bc32401 5/6: Replace std::shared_ptr with std::unique_ptr, Greg Chicares, 2018/10/19
- [lmi-commits] [lmi] master 86bf250 2/6: Reorder a statement, Greg Chicares, 2018/10/19
- [lmi-commits] [lmi] master 2ba6003 6/6: Dispense with smart pointers, Greg Chicares, 2018/10/19