[libsigcplusplus] C++11: Use = default for simple default constructors.



commit ead743d326f2d45260925799e1e2618d263ed4c1
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Apr 1 18:40:41 2016 +0200

    C++11: Use = default for simple default constructors.
    
    With help from clang-tidy, like so:
    clang-tidy-3.8 -fix --checks=modernize-use-default --header-filter=.*  `find . -name "*.cc"`
    after using "bear make all check".

 sigc++/adaptors/adaptor_trait.h   |    2 +-
 sigc++/adaptors/exception_catch.h |    4 ++--
 sigc++/adaptors/retype_return.h   |    4 ++--
 sigc++/functors/ptr_fun.h         |    2 +-
 sigc++/functors/slot.h            |    2 +-
 sigc++/signal.h                   |   10 +++++-----
 6 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/sigc++/adaptors/adaptor_trait.h b/sigc++/adaptors/adaptor_trait.h
index c6e77a4..2c7dda2 100644
--- a/sigc++/adaptors/adaptor_trait.h
+++ b/sigc++/adaptors/adaptor_trait.h
@@ -88,7 +88,7 @@ struct adaptor_functor : public adaptor_base
   }
 
   /// Constructs an invalid functor.
-  adaptor_functor() {}
+  adaptor_functor() = default;
 
   /** Constructs an adaptor_functor object that wraps the passed functor.
    * @param _A_functor Functor to invoke from operator()().
diff --git a/sigc++/adaptors/exception_catch.h b/sigc++/adaptors/exception_catch.h
index 5ec721c..4f8b76c 100644
--- a/sigc++/adaptors/exception_catch.h
+++ b/sigc++/adaptors/exception_catch.h
@@ -115,12 +115,12 @@ struct exception_catch_functor<T_functor, T_catcher, void> : public adapts<T_fun
     }
   }
 
-  exception_catch_functor() {}
+  exception_catch_functor() = default;
   exception_catch_functor(const T_functor& _A_func, const T_catcher& _A_catcher)
   : adapts<T_functor>(_A_func), catcher_(_A_catcher)
   {
   }
-  ~exception_catch_functor() {}
+  ~exception_catch_functor() = default;
 
   T_catcher catcher_;
 };
diff --git a/sigc++/adaptors/retype_return.h b/sigc++/adaptors/retype_return.h
index 52f3468..a261b43 100644
--- a/sigc++/adaptors/retype_return.h
+++ b/sigc++/adaptors/retype_return.h
@@ -28,7 +28,7 @@ struct retype_return_functor : public adapts<T_functor>
     return T_return(this->functor_.template operator() < T_arg... > (std::forward<T_arg>(_A_a)...));
   }
 
-  retype_return_functor() {}
+  retype_return_functor() = default;
 
   /** Constructs a retype_return_functor object that perform a C-style cast on the return value of
    * the passed functor.
@@ -70,7 +70,7 @@ struct retype_return_functor<void, T_functor> : public adapts<T_functor>
     this->functor_.template operator()<T_arg...>(_A_a...);
   }
 
-  retype_return_functor() {}
+  retype_return_functor() = default;
   retype_return_functor(type_trait_take_t<T_functor> _A_functor) : adapts<T_functor>(_A_functor) {}
 };
 
diff --git a/sigc++/functors/ptr_fun.h b/sigc++/functors/ptr_fun.h
index ec8e120..1c628bd 100644
--- a/sigc++/functors/ptr_fun.h
+++ b/sigc++/functors/ptr_fun.h
@@ -64,7 +64,7 @@ public:
   using result_type = T_return;
 
   /// Constructs an invalid functor.
-  pointer_functor() {}
+  pointer_functor() = default;
 
   /** Constructs a pointer_functor2 object that wraps an existing function.
    * @param _A_func Pointer to function that will be invoked from operator()().
diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h
index b658090..f186ba8 100644
--- a/sigc++/functors/slot.h
+++ b/sigc++/functors/slot.h
@@ -178,7 +178,7 @@ public:
     return T_return();
   }
 
-  inline slot() {}
+  inline slot() = default;
 
   /** Constructs a slot from an arbitrary functor.
    * @param _A_func The desired functor the new slot should be assigned to.
diff --git a/sigc++/signal.h b/sigc++/signal.h
index 52b9ca3..57ca6c6 100644
--- a/sigc++/signal.h
+++ b/sigc++/signal.h
@@ -51,7 +51,7 @@ struct slot_iterator
 
   using iterator_type = typename internal::signal_impl::iterator_type;
 
-  slot_iterator() {}
+  slot_iterator() = default;
 
   explicit slot_iterator(const iterator_type& i) : i_(i) {}
 
@@ -111,7 +111,7 @@ struct slot_const_iterator
 
   using iterator_type = typename internal::signal_impl::const_iterator_type;
 
-  slot_const_iterator() {}
+  slot_const_iterator() = default;
 
   explicit slot_const_iterator(const iterator_type& i) : i_(i) {}
 
@@ -940,7 +940,7 @@ public:
     return slot_list_type(const_cast<signal_with_accumulator*>(this)->impl());
   }
 
-  signal_with_accumulator() {}
+  signal_with_accumulator() = default;
 
   signal_with_accumulator(const signal_with_accumulator& src) : signal_base(src) {}
 
@@ -1058,14 +1058,14 @@ public:
   class accumulated : public signal_with_accumulator<T_return, T_accumulator, T_arg...>
   {
   public:
-    accumulated() {}
+    accumulated() = default;
     accumulated(const accumulated& src)
     : signal_with_accumulator<T_return, T_accumulator, T_arg...>(src)
     {
     }
   };
 
-  signal() {}
+  signal() = default;
 
   signal(const signal& src) : signal_with_accumulator<T_return, accumulator_type, T_arg...>(src) {}
 


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