[libsigcplusplus] C++11: slot: Use = default for simple copy constructor.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsigcplusplus] C++11: slot: Use = default for simple copy constructor.
- Date: Fri, 1 Apr 2016 16:51:57 +0000 (UTC)
commit 20e91aa4f5374cfa01698caea8ac83c380befea2
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Apr 1 18:45:17 2016 +0200
C++11: slot: Use = default for simple copy constructor.
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++/functors/slot.h | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/sigc++/functors/slot.h b/sigc++/functors/slot.h
index f186ba8..91b42cd 100644
--- a/sigc++/functors/slot.h
+++ b/sigc++/functors/slot.h
@@ -193,7 +193,7 @@ public:
/** Constructs a slot, copying an existing one.
* @param src The existing slot to copy.
*/
- slot(const slot& src) : slot_base(src) {}
+ slot(const slot& src) = default;
/** Constructs a slot, moving an existing one.
* If @p src is connected to a parent (e.g. a signal), it is copied, not moved.
@@ -206,10 +206,7 @@ public:
* @return @p this.
*/
slot& operator=(const slot& src)
- {
- slot_base::operator=(src);
- return *this;
- }
+ = default;
/** Overrides this slot, making a move from another slot.
* If @p src is connected to a parent (e.g. a signal), it is copied, not moved.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]