lmi
[Top][All Lists]
Advanced

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

Re: [lmi] depr.impldec


From: Greg Chicares
Subject: Re: [lmi] depr.impldec
Date: Wed, 13 Jul 2022 22:38:21 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

On 7/13/22 21:52, Greg Chicares wrote:
[...]
> let me propose a ready-to commit change

...which left the dtor virtual.

I really would like to commit that change, because I think
the special member functions should be protected. And that
was the sole original motivation for that revision.

But this discussion is about making the now-protected
dtor non-virtual. Deleting the word "virtual" doesn't
quite make it compile. Sorry for overlooking that.

With the changes below, it actually does compile. I added
numerous special member functions in a couple of cases
where the Rule of Zero had sufficed; I haven't gone over
that carefully to see whether there's any other way, but
if we're going to "Rule-of-Five All The Things" [RoFAtT],
then we'd do this anyway.

I wouldn't ordinarily post such a raw patch, but the
problem with my original email demands remediation,
and perhaps this will suggest whether RoFAtT is a
path worth taking.

--8<----8<----8<----8<----8<----8<----8<----8<--
diff --git a/datum_base.hpp b/datum_base.hpp
index c57aca38e..0d1f80faa 100644
--- a/datum_base.hpp
+++ b/datum_base.hpp
@@ -43,7 +43,7 @@ class LMI_SO datum_base
     datum_base(datum_base&&) = default;
     datum_base& operator=(datum_base const&) = default;
     datum_base& operator=(datum_base&&) = default;
-    virtual ~datum_base() = default;
+    ~datum_base() = default;
 
   private:
     bool enabled_ {true};
diff --git a/datum_boolean.hpp b/datum_boolean.hpp
index accd1a92e..29f4181b5 100644
--- a/datum_boolean.hpp
+++ b/datum_boolean.hpp
@@ -36,7 +36,7 @@ class datum_boolean final
     datum_boolean(datum_boolean&&) = default;
     datum_boolean& operator=(datum_boolean const&) = default;
     datum_boolean& operator=(datum_boolean&&) = default;
-    ~datum_boolean() override = default;
+    ~datum_boolean() = default;
 
     datum_boolean& operator=(bool);
 
diff --git a/datum_string.hpp b/datum_string.hpp
index 68fc7188d..671be8b0c 100644
--- a/datum_string.hpp
+++ b/datum_string.hpp
@@ -41,7 +41,7 @@ class datum_string
     datum_string(datum_string&&) = default;
     datum_string& operator=(datum_string const&) = default;
     datum_string& operator=(datum_string&&) = default;
-    ~datum_string() override = default;
+    virtual ~datum_string() = default;
 
     datum_string& operator=(std::string const&);
 
diff --git a/mc_enum.hpp b/mc_enum.hpp
index e01434d71..5ff869237 100644
--- a/mc_enum.hpp
+++ b/mc_enum.hpp
@@ -55,6 +55,13 @@ class LMI_SO mc_enum_base
   public:
     explicit mc_enum_base(int);
 
+    mc_enum_base() = delete;
+    mc_enum_base(mc_enum_base const&) = default;
+    mc_enum_base(mc_enum_base&&) = default;
+    mc_enum_base& operator=(mc_enum_base const&) = default;
+    mc_enum_base& operator=(mc_enum_base&&) = default;
+    virtual ~mc_enum_base() = default;
+
     void allow(int, bool);
     void allow_all(bool);
     int  first_allowed_ordinal() const;
diff --git a/tn_range.hpp b/tn_range.hpp
index fe6de2ba6..bea2e8caf 100644
--- a/tn_range.hpp
+++ b/tn_range.hpp
@@ -133,6 +133,13 @@ class LMI_SO tn_range_base
     :public datum_base
 {
   public:
+    tn_range_base() = default;
+    tn_range_base(tn_range_base const&) = default;
+    tn_range_base(tn_range_base&&) = default;
+    tn_range_base& operator=(tn_range_base const&) = default;
+    tn_range_base& operator=(tn_range_base&&) = default;
+    virtual ~tn_range_base() = default;
+
     bool operator==(std::string const& s) const {return equal_to(s);}
 
     virtual std::string diagnose_invalidity(std::string const&) const = 0;
--8<----8<----8<----8<----8<----8<----8<----8<--


reply via email to

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