[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master cc8f6e3e 3/5: Make special member functions l
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master cc8f6e3e 3/5: Make special member functions less irrational |
Date: |
Mon, 11 Jul 2022 22:53:09 -0400 (EDT) |
branch: master
commit cc8f6e3e063c41e0749f526e2c62d0c1b420cfd7
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Make special member functions less irrational
These special members were marked "= default" if used, and "= delete"
otherwise. While that's interesting information, it's not good practice.
Because these are fairly plain classes with no exotic data members, made
all special members "= default" because if any is correct, then they all
should be correct.
Running this command:
git diff HEAD~3 -- `git diff --name-only`
immediately before this commit showed that all had changed in exactly
the same way: they gained five explicitly defaulted special members.
The question is whether this makes them better, or worse.
Class glossed_string in 'product_data.hpp' differed in exactly that same
way, but didn't need to be modified in this commit.
---
dbvalue.hpp | 2 +-
fund_data.hpp | 2 +-
illustrator.hpp | 4 ++--
ledger.hpp | 6 +++---
rounding_rules.hpp | 2 +-
stratified_charges.hpp | 2 +-
test_coding_rules.cpp | 6 +++---
yare_input.hpp | 6 +++---
8 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/dbvalue.hpp b/dbvalue.hpp
index 6e27f797..152a97ce 100644
--- a/dbvalue.hpp
+++ b/dbvalue.hpp
@@ -79,7 +79,7 @@ class LMI_SO database_entity final
);
database_entity(database_entity const&) = default;
- database_entity(database_entity&&) = delete;
+ database_entity(database_entity&&) = default;
database_entity& operator=(database_entity const&) = default;
database_entity& operator=(database_entity&&) = default;
~database_entity() = default;
diff --git a/fund_data.hpp b/fund_data.hpp
index 96be4017..fc16d856 100644
--- a/fund_data.hpp
+++ b/fund_data.hpp
@@ -50,7 +50,7 @@ class LMI_SO FundInfo final
FundInfo(FundInfo const&) = default;
FundInfo(FundInfo&&) = default;
- FundInfo& operator=(FundInfo const&) = delete;
+ FundInfo& operator=(FundInfo const&) = default;
FundInfo& operator=(FundInfo&&) = default;
~FundInfo() = default;
diff --git a/illustrator.hpp b/illustrator.hpp
index 62209d8a..268ffbba 100644
--- a/illustrator.hpp
+++ b/illustrator.hpp
@@ -45,8 +45,8 @@ class LMI_SO illustrator final
illustrator(illustrator const&) = default;
illustrator(illustrator&&) = default;
- illustrator& operator=(illustrator const&) = delete;
- illustrator& operator=(illustrator&&) = delete;
+ illustrator& operator=(illustrator const&) = default;
+ illustrator& operator=(illustrator&&) = default;
~illustrator() = default;
bool operator()(fs::path const&);
diff --git a/ledger.hpp b/ledger.hpp
index 2fdbd511..3f3e7e0a 100644
--- a/ledger.hpp
+++ b/ledger.hpp
@@ -74,9 +74,9 @@ class LMI_SO Ledger final
);
Ledger(Ledger const&) = default;
- Ledger(Ledger&&) = delete;
- Ledger& operator=(Ledger const&) = delete;
- Ledger& operator=(Ledger&&) = delete;
+ Ledger(Ledger&&) = default;
+ Ledger& operator=(Ledger const&) = default;
+ Ledger& operator=(Ledger&&) = default;
virtual ~Ledger() = default;
void ZeroInforceAfterLapse();
diff --git a/rounding_rules.hpp b/rounding_rules.hpp
index 9d986ef0..e5ae95f1 100644
--- a/rounding_rules.hpp
+++ b/rounding_rules.hpp
@@ -50,7 +50,7 @@ class LMI_SO rounding_parameters final
);
rounding_parameters(rounding_parameters const&) = default;
- rounding_parameters(rounding_parameters&&) = delete;
+ rounding_parameters(rounding_parameters&&) = default;
rounding_parameters& operator=(rounding_parameters const&) = default;
rounding_parameters& operator=(rounding_parameters&&) = default;
~rounding_parameters() = default;
diff --git a/stratified_charges.hpp b/stratified_charges.hpp
index 50b1a2ee..a292e534 100644
--- a/stratified_charges.hpp
+++ b/stratified_charges.hpp
@@ -79,7 +79,7 @@ class LMI_SO stratified_entity final
);
stratified_entity(stratified_entity const&) = default;
- stratified_entity(stratified_entity&&) = delete;
+ stratified_entity(stratified_entity&&) = default;
stratified_entity& operator=(stratified_entity const&) = default;
stratified_entity& operator=(stratified_entity&&) = default;
~stratified_entity() = default;
diff --git a/test_coding_rules.cpp b/test_coding_rules.cpp
index a9253f35..c4dba41d 100644
--- a/test_coding_rules.cpp
+++ b/test_coding_rules.cpp
@@ -1171,10 +1171,10 @@ class statistics
public:
statistics() = default;
- statistics(statistics const&) = delete;
+ statistics(statistics const&) = default;
statistics(statistics&&) = default;
- statistics& operator=(statistics const&) = delete;
- statistics& operator=(statistics&&) = delete;
+ statistics& operator=(statistics const&) = default;
+ statistics& operator=(statistics&&) = default;
~statistics() = default;
statistics& operator+=(statistics const&);
diff --git a/yare_input.hpp b/yare_input.hpp
index 7f3f1751..67a66f2d 100644
--- a/yare_input.hpp
+++ b/yare_input.hpp
@@ -55,10 +55,10 @@ class yare_input final
public:
explicit yare_input(Input const&);
- yare_input(yare_input const&) = delete;
+ yare_input(yare_input const&) = default;
yare_input(yare_input&&) = default;
- yare_input& operator=(yare_input const&) = delete;
- yare_input& operator=(yare_input&&) = delete;
+ yare_input& operator=(yare_input const&) = default;
+ yare_input& operator=(yare_input&&) = default;
~yare_input() = default;
int IssueAge ;