lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master c025291 4/6: Write explicitly-defaulted dtor


From: Greg Chicares
Subject: [lmi-commits] [lmi] master c025291 4/6: Write explicitly-defaulted dtor inline, in class defn
Date: Mon, 6 Mar 2017 19:46:58 -0500 (EST)

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

    Write explicitly-defaulted dtor inline, in class defn
    
    This commit also simplifies a ctor that cannot be explicitly defaulted,
    by substituting brace-or-equal-initializers for ctor-initializers.
---
 antediluvian_stubs.cpp |  2 --
 mec_server.cpp         |  5 -----
 mec_server.hpp         | 12 ++++++------
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/antediluvian_stubs.cpp b/antediluvian_stubs.cpp
index fc10ab3..949889e 100644
--- a/antediluvian_stubs.cpp
+++ b/antediluvian_stubs.cpp
@@ -77,8 +77,6 @@ bool gpt_state::is_detritus(std::string const&) const
 mec_server::mec_server(mcenum_emission)
 {}
 
-mec_server::~mec_server() = default;
-
 bool mec_server::operator()(fs::path const&)
 {
     return false;
diff --git a/mec_server.cpp b/mec_server.cpp
index 3916e6d..0e41245 100644
--- a/mec_server.cpp
+++ b/mec_server.cpp
@@ -494,14 +494,9 @@ mec_state test_one_days_7702A_transactions
 
 mec_server::mec_server(mcenum_emission emission)
     :emission_                 (emission)
-    ,seconds_for_input_        (0.0)
-    ,seconds_for_calculations_ (0.0)
-    ,seconds_for_output_       (0.0)
 {
 }
 
-mec_server::~mec_server() = default;
-
 bool mec_server::operator()(fs::path const& file_path)
 {
     std::string const extension = fs::extension(file_path);
diff --git a/mec_server.hpp b/mec_server.hpp
index f9382e0..385d726 100644
--- a/mec_server.hpp
+++ b/mec_server.hpp
@@ -51,7 +51,7 @@ class LMI_SO mec_server final
 {
   public:
     explicit mec_server(mcenum_emission);
-    ~mec_server();
+    ~mec_server() = default;
 
     bool operator()(fs::path const&);
     bool operator()(fs::path const&, mec_input const&);
@@ -65,11 +65,11 @@ class LMI_SO mec_server final
     double seconds_for_output      () const;
 
   private:
-    mcenum_emission emission_;
-    mec_state state_;
-    double seconds_for_input_;
-    double seconds_for_calculations_;
-    double seconds_for_output_;
+    mcenum_emission emission_        {mce_emit_nothing};
+    mec_state state_                 {};
+    double seconds_for_input_        {0.0};
+    double seconds_for_calculations_ {0.0};
+    double seconds_for_output_       {0.0};
 };
 
 #endif // mec_server_hpp



reply via email to

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