[glom] C++11: Use =default for simple destructors.



commit 992fcf2504b43d062a3297b95310f7cc3560b7d6
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Nov 8 13:14:04 2016 +0100

    C++11: Use =default for simple destructors.

 glom/libglom/connectionpool.cc                     |    4 ----
 glom/libglom/connectionpool.h                      |    2 +-
 glom/libglom/connectionpool_backends/backend.h     |    3 ++-
 glom/libglom/data_structure/has_title_singular.cc  |    4 ----
 glom/libglom/data_structure/has_title_singular.h   |    2 +-
 glom/libglom/data_structure/layout/layoutitem.cc   |    4 ----
 glom/libglom/data_structure/layout/layoutitem.h    |    2 +-
 glom/libglom/data_structure/translatable_item.cc   |    4 ----
 glom/libglom/data_structure/translatable_item.h    |    2 +-
 glom/libglom/document/bakery/document.cc           |    4 ----
 glom/libglom/document/bakery/document.h            |    2 +-
 glom/libglom/document/bakery/view/viewbase.cc      |    4 ----
 glom/libglom/document/bakery/view/viewbase.h       |    2 +-
 glom/libglom/python_embed/py_glom_record.cc        |    4 ----
 glom/libglom/python_embed/py_glom_record.h         |    2 +-
 glom/libglom/python_embed/py_glom_related.cc       |    5 -----
 glom/libglom/python_embed/py_glom_related.h        |    2 +-
 glom/libglom/python_embed/py_glom_relatedrecord.cc |    5 -----
 glom/libglom/python_embed/py_glom_relatedrecord.h  |    2 +-
 glom/libglom/python_embed/py_glom_ui.cc            |    4 ----
 glom/libglom/python_embed/py_glom_ui.h             |    2 +-
 glom/utility_widgets/imageglom.cc                  |    6 ------
 glom/utility_widgets/imageglom.h                   |    3 +--
 23 files changed, 13 insertions(+), 61 deletions(-)
---
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index ccbb81f..fbac875 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -112,10 +112,6 @@ ConnectionPool::ConnectionPool()
 {
 }
 
-ConnectionPool::~ConnectionPool()
-{
-}
-
 //static
 std::shared_ptr<ConnectionPool> ConnectionPool::get_instance()
 {
diff --git a/glom/libglom/connectionpool.h b/glom/libglom/connectionpool.h
index 80403da..ad92fb4 100644
--- a/glom/libglom/connectionpool.h
+++ b/glom/libglom/connectionpool.h
@@ -84,7 +84,7 @@ public:
   //This are public for use by std::make_shared<>().
   //TODO: Does this need to be virtual?
   ConnectionPool();
-  virtual ~ConnectionPool();
+  virtual ~ConnectionPool() = default;
 
   ConnectionPool(const ConnectionPool& src) = delete;
   ConnectionPool(ConnectionPool&& src) = default;
diff --git a/glom/libglom/connectionpool_backends/backend.h b/glom/libglom/connectionpool_backends/backend.h
index 729d853..b03882b 100644
--- a/glom/libglom/connectionpool_backends/backend.h
+++ b/glom/libglom/connectionpool_backends/backend.h
@@ -65,7 +65,8 @@ class Backend
 {
   friend class Glom::ConnectionPool;
 public:
-  virtual ~Backend() {}
+  virtual ~Backend() = default;
+
   typedef std::vector<std::shared_ptr<const Field> > type_vec_const_fields;
 
   enum class InitErrors
diff --git a/glom/libglom/data_structure/has_title_singular.cc 
b/glom/libglom/data_structure/has_title_singular.cc
index 721d4ee..042223d 100644
--- a/glom/libglom/data_structure/has_title_singular.cc
+++ b/glom/libglom/data_structure/has_title_singular.cc
@@ -28,10 +28,6 @@ HasTitleSingular::HasTitleSingular()
 {
 }
 
-HasTitleSingular::~HasTitleSingular()
-{
-}
-
 bool HasTitleSingular::operator==(const HasTitleSingular& src) const
 {
   const bool bResult = (m_title_singular == src.m_title_singular);
diff --git a/glom/libglom/data_structure/has_title_singular.h 
b/glom/libglom/data_structure/has_title_singular.h
index e9bd7c7..5faab76 100644
--- a/glom/libglom/data_structure/has_title_singular.h
+++ b/glom/libglom/data_structure/has_title_singular.h
@@ -36,7 +36,7 @@ public:
   HasTitleSingular();
   HasTitleSingular(const HasTitleSingular& src) = default;
   HasTitleSingular(HasTitleSingular&& src) = default;
-  virtual ~HasTitleSingular();
+  virtual ~HasTitleSingular() = default;
 
   HasTitleSingular& operator=(const HasTitleSingular& src) = default;
   HasTitleSingular& operator=(HasTitleSingular&& src) = default;
diff --git a/glom/libglom/data_structure/layout/layoutitem.cc 
b/glom/libglom/data_structure/layout/layoutitem.cc
index 783d022..21469b6 100644
--- a/glom/libglom/data_structure/layout/layoutitem.cc
+++ b/glom/libglom/data_structure/layout/layoutitem.cc
@@ -58,10 +58,6 @@ LayoutItem::LayoutItem(const LayoutItem& src)
     m_positions = std::make_unique<PrintLayoutPosition>(*(src.m_positions));
 }
 
-LayoutItem::~LayoutItem()
-{
-}
-
 LayoutItem& LayoutItem::operator=(const LayoutItem& src)
 {
   if(this == &src)
diff --git a/glom/libglom/data_structure/layout/layoutitem.h b/glom/libglom/data_structure/layout/layoutitem.h
index f5c8975..4874520 100644
--- a/glom/libglom/data_structure/layout/layoutitem.h
+++ b/glom/libglom/data_structure/layout/layoutitem.h
@@ -36,7 +36,7 @@ public:
   LayoutItem(LayoutItem&& src) = default;
   LayoutItem& operator=(const LayoutItem& src);
   LayoutItem& operator=(LayoutItem&& src) = default;
-  ~LayoutItem() override;
+  ~LayoutItem() override = default;
 
   /** Create a new copied instance.
    * This allows us to deep-copy a list of LayoutItems.
diff --git a/glom/libglom/data_structure/translatable_item.cc 
b/glom/libglom/data_structure/translatable_item.cc
index 8fa6153..f79738b 100644
--- a/glom/libglom/data_structure/translatable_item.cc
+++ b/glom/libglom/data_structure/translatable_item.cc
@@ -31,10 +31,6 @@ TranslatableItem::TranslatableItem() noexcept
 {
 }
 
-TranslatableItem::~TranslatableItem()
-{
-}
-
 bool TranslatableItem::operator==(const TranslatableItem& src) const noexcept
 {
   bool bResult = (m_name == src.m_name)
diff --git a/glom/libglom/data_structure/translatable_item.h b/glom/libglom/data_structure/translatable_item.h
index 7bbf78b..7891982 100644
--- a/glom/libglom/data_structure/translatable_item.h
+++ b/glom/libglom/data_structure/translatable_item.h
@@ -35,7 +35,7 @@ public:
   TranslatableItem() noexcept;
   TranslatableItem(const TranslatableItem& src) = default;
   TranslatableItem(TranslatableItem&& src) = default;
-  virtual ~TranslatableItem();
+  virtual ~TranslatableItem() = default;
 
   TranslatableItem& operator=(const TranslatableItem& src) = default;
   TranslatableItem& operator=(TranslatableItem&& src) = default;
diff --git a/glom/libglom/document/bakery/document.cc b/glom/libglom/document/bakery/document.cc
index 98ad171..d39aee6 100644
--- a/glom/libglom/document/bakery/document.cc
+++ b/glom/libglom/document/bakery/document.cc
@@ -36,10 +36,6 @@ Document::Document()
   m_view = nullptr;
 }
 
-Document::~Document()
-{
-}
-
 Glib::ustring Document::get_file_uri() const
 {
   return m_file_uri;
diff --git a/glom/libglom/document/bakery/document.h b/glom/libglom/document/bakery/document.h
index f64957e..57f7030 100644
--- a/glom/libglom/document/bakery/document.h
+++ b/glom/libglom/document/bakery/document.h
@@ -34,7 +34,7 @@ class Document
 {
 public:
   Document();
-  virtual ~Document();
+  virtual ~Document() = default;
 
   /* Saves the data to disk.
    * Asks the View to update this document before saving to disk,
diff --git a/glom/libglom/document/bakery/view/viewbase.cc b/glom/libglom/document/bakery/view/viewbase.cc
index bfe98ef..6255c2f 100644
--- a/glom/libglom/document/bakery/view/viewbase.cc
+++ b/glom/libglom/document/bakery/view/viewbase.cc
@@ -25,10 +25,6 @@ ViewBase::ViewBase()
 {
 }
 
-ViewBase::~ViewBase()
-{
-}
-
 void ViewBase::load_from_document()
 {
 }
diff --git a/glom/libglom/document/bakery/view/viewbase.h b/glom/libglom/document/bakery/view/viewbase.h
index 1976a88..e7e5045 100644
--- a/glom/libglom/document/bakery/view/viewbase.h
+++ b/glom/libglom/document/bakery/view/viewbase.h
@@ -32,7 +32,7 @@ class ViewBase : virtual public sigc::trackable
 {
 public:
   ViewBase();
-  virtual ~ViewBase();
+  virtual ~ViewBase() = default;
 
   virtual void load_from_document();
   virtual void save_to_document();
diff --git a/glom/libglom/python_embed/py_glom_record.cc b/glom/libglom/python_embed/py_glom_record.cc
index 7eb7848..64a3281 100644
--- a/glom/libglom/python_embed/py_glom_record.cc
+++ b/glom/libglom/python_embed/py_glom_record.cc
@@ -42,10 +42,6 @@ PyGlomRecord::PyGlomRecord()
 {
 }
 
-PyGlomRecord::~PyGlomRecord()
-{
-}
-
 void PyGlomRecord::set_read_only()
 {
   m_read_only = true;
diff --git a/glom/libglom/python_embed/py_glom_record.h b/glom/libglom/python_embed/py_glom_record.h
index d014c1d..2d844b7 100644
--- a/glom/libglom/python_embed/py_glom_record.h
+++ b/glom/libglom/python_embed/py_glom_record.h
@@ -36,7 +36,7 @@ class PyGlomRecord
 {
 public:
   PyGlomRecord();
-  ~PyGlomRecord();
+  ~PyGlomRecord() = default;
 
   /* Prevent python code from changing data in the database via this object.
    * For instance, this should be used in a field calculation,
diff --git a/glom/libglom/python_embed/py_glom_related.cc b/glom/libglom/python_embed/py_glom_related.cc
index 98ebed5..05c6495 100644
--- a/glom/libglom/python_embed/py_glom_related.cc
+++ b/glom/libglom/python_embed/py_glom_related.cc
@@ -29,11 +29,6 @@ PyGlomRelated::PyGlomRelated()
 {
 }
 
-PyGlomRelated::~PyGlomRelated()
-{
-}
-
-
 PyGlomRelated::type_map_relationships::size_type PyGlomRelated::len() const
 {
   return m_map_relationships.size();
diff --git a/glom/libglom/python_embed/py_glom_related.h b/glom/libglom/python_embed/py_glom_related.h
index cba9c90..1ae49aa 100644
--- a/glom/libglom/python_embed/py_glom_related.h
+++ b/glom/libglom/python_embed/py_glom_related.h
@@ -35,7 +35,7 @@ class PyGlomRelated
 {
 public:
   PyGlomRelated();
-  ~PyGlomRelated();
+  ~PyGlomRelated() = default;
 
   typedef std::unordered_map<Glib::ustring, std::shared_ptr<Relationship> , std::hash<std::string>> 
type_map_relationships;
   void set_relationships(const PyGlomRelated::type_map_relationships& relationships);
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.cc 
b/glom/libglom/python_embed/py_glom_relatedrecord.cc
index ceb7080..ed97d2d 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.cc
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.cc
@@ -34,11 +34,6 @@ PyGlomRelatedRecord::PyGlomRelatedRecord()
 {
 }
 
-PyGlomRelatedRecord::~PyGlomRelatedRecord()
-{
-}
-
-
 static void RelatedRecord_HandlePythonError()
 {
   if(PyErr_Occurred())
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.h 
b/glom/libglom/python_embed/py_glom_relatedrecord.h
index 0b7d335..cacb4e7 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.h
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.h
@@ -36,7 +36,7 @@ class PyGlomRelatedRecord
 {
 public:
   PyGlomRelatedRecord();
-  ~PyGlomRelatedRecord();
+  ~PyGlomRelatedRecord() = default;
 
   void set_relationship(const std::shared_ptr<const Relationship>& relationship, const Gnome::Gda::Value& 
from_key_value, const std::shared_ptr<const Document>& document);
 
diff --git a/glom/libglom/python_embed/py_glom_ui.cc b/glom/libglom/python_embed/py_glom_ui.cc
index 9b68dd6..a02c67d 100644
--- a/glom/libglom/python_embed/py_glom_ui.cc
+++ b/glom/libglom/python_embed/py_glom_ui.cc
@@ -35,10 +35,6 @@ PyGlomUI::PyGlomUI(const PythonUICallbacks& callbacks)
 {
 }
 
-PyGlomUI::~PyGlomUI()
-{
-}
-
 void PyGlomUI::show_table_details(const std::string& table_name, const boost::python::object& 
primary_key_value)
 {
   if(!m_callbacks || !(m_callbacks->m_slot_show_table_details))
diff --git a/glom/libglom/python_embed/py_glom_ui.h b/glom/libglom/python_embed/py_glom_ui.h
index 21dbc8f..abdc068 100644
--- a/glom/libglom/python_embed/py_glom_ui.h
+++ b/glom/libglom/python_embed/py_glom_ui.h
@@ -36,7 +36,7 @@ public:
   //A default constructor seems to be necessary for boost::python
   PyGlomUI();
   explicit PyGlomUI(const PythonUICallbacks& callbacks);
-  ~PyGlomUI();
+  ~PyGlomUI() = default;
 
   /** Navigate to the named table, showing the details view for the specified record.
    */
diff --git a/glom/utility_widgets/imageglom.cc b/glom/utility_widgets/imageglom.cc
index 9465451..fc994f1 100644
--- a/glom/utility_widgets/imageglom.cc
+++ b/glom/utility_widgets/imageglom.cc
@@ -142,12 +142,6 @@ void ImageGlom::init()
   add(m_frame);
 }
 
-
-
-ImageGlom::~ImageGlom()
-{
-}
-
 void ImageGlom::set_layout_item(const std::shared_ptr<LayoutItem>& layout_item, const Glib::ustring& 
table_name)
 {
   LayoutWidgetField::set_layout_item(layout_item, table_name);
diff --git a/glom/utility_widgets/imageglom.h b/glom/utility_widgets/imageglom.h
index b20fe5b..f6e1715 100644
--- a/glom/utility_widgets/imageglom.h
+++ b/glom/utility_widgets/imageglom.h
@@ -46,8 +46,7 @@ public:
   ImageGlom();
   explicit ImageGlom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
 
-
-  virtual ~ImageGlom();
+  ~ImageGlom() override = default;
 
   void set_layout_item(const std::shared_ptr<LayoutItem>& layout_item, const Glib::ustring& table_name) 
override;
 


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