lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 3a2c252 3/5: Implement pure virtual dtor inli


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 3a2c252 3/5: Implement pure virtual dtor inline in header
Date: Mon, 6 Mar 2017 07:24:18 -0500 (EST)

branch: master
commit 3a2c252930b2196b00cb994618ccf00045f7b664
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Implement pure virtual dtor inline in header
---
 datum_sequence.cpp |  2 --
 datum_sequence.hpp | 11 ++++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/datum_sequence.cpp b/datum_sequence.cpp
index f14a390..f97fa15 100644
--- a/datum_sequence.cpp
+++ b/datum_sequence.cpp
@@ -46,8 +46,6 @@ datum_sequence::datum_sequence(std::string const& s)
     assert_sanity();
 }
 
-datum_sequence::~datum_sequence() = default;
-
 datum_sequence& datum_sequence::operator=(std::string const& s)
 {
     datum_string::operator=(s);
diff --git a/datum_sequence.hpp b/datum_sequence.hpp
index 09f9e17..1e218d3 100644
--- a/datum_sequence.hpp
+++ b/datum_sequence.hpp
@@ -33,7 +33,7 @@
 #include <map>
 #include <string>
 
-/// Base class for MVC input sequences.
+/// Abstract base class for MVC input sequences.
 ///
 /// Sequences are formed of values and intervals. Intervals may always
 /// be specified by numbers, keywords, or a combination of both. Each
@@ -94,6 +94,15 @@ class datum_sequence
     bool keyword_values_are_blocked_;
 };
 
+/// Implementation of pure virtual destructor.
+///
+/// Neither this explicitly-defaulted implementation nor any other can
+/// be written inside the class definition because C++11 [10.4/3] says
+/// "a function declaration cannot provide both a pure-specifier and a
+/// definition".
+
+inline datum_sequence::~datum_sequence() = default;
+
 bool operator==(datum_sequence const&, datum_sequence const&);
 
 // Specialize value_cast<> for each derived class, e.g., as follows:



reply via email to

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