summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-27 01:37:13 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-27 01:37:13 +0100
commit495e2de57e587450e9532c7fe4ae0c2bfb196e6c (patch)
tree7b9b499cd258717901c6da9f9cea768d24262652 /src
parenta453da28ddc856176747927a47d21af2bd4d4909 (diff)
Marked move constructors noexcept (allows move constructor to be used when type is used within a stl container)
Diffstat (limited to 'src')
-rw-r--r--src/core/common/Logger.hpp14
-rw-r--r--src/core/common/Variant.hpp6
-rw-r--r--src/core/managed/Managed.hpp10
-rw-r--r--src/core/managed/ManagedContainer.hpp4
4 files changed, 10 insertions, 24 deletions
diff --git a/src/core/common/Logger.hpp b/src/core/common/Logger.hpp
index 479160b..433aa31 100644
--- a/src/core/common/Logger.hpp
+++ b/src/core/common/Logger.hpp
@@ -269,12 +269,6 @@ public:
// Default constructor
Logger() {}
- // No copy
- Logger(const Logger &) = delete;
-
- // No assign
- Logger &operator=(const Logger &) = delete;
-
/**
* Logs the given message. The file name is set to the topmost file name on
* the file name stack.
@@ -601,14 +595,6 @@ protected:
SourceContextCallback sourceContextCallback) override;
public:
- // Default move constructor
- LoggerFork(LoggerFork &&l)
- : calls(std::move(l.calls)),
- messages(std::move(l.messages)),
- locations(std::move(l.locations)),
- callbacks(std::move(l.callbacks)),
- parent(std::move(l.parent)){};
-
/**
* Commits all collected messages to the parent Logger instance.
*/
diff --git a/src/core/common/Variant.hpp b/src/core/common/Variant.hpp
index fc4faf5..103c0e7 100644
--- a/src/core/common/Variant.hpp
+++ b/src/core/common/Variant.hpp
@@ -211,7 +211,7 @@ private:
*
* @param v is the Variant instance that should be copied to this instance.
*/
- void move(Variant &&v)
+ void move(Variant &&v) noexcept
{
destroy();
type = v.type;
@@ -290,7 +290,7 @@ public:
* @param v is the reference to the Variant instance that should be moved,
* this instance is invalidated afterwards.
*/
- Variant(Variant &&v) : ptrVal(nullptr) { move(std::move(v)); }
+ Variant(Variant &&v) noexcept : ptrVal(nullptr) { move(std::move(v)); }
/**
* Default constructor. VariantType is set to VariantType:NULLPTR.
@@ -413,7 +413,7 @@ public:
/**
* Move assignment operator.
*/
- Variant &operator=(Variant &&v)
+ Variant &operator=(Variant &&v) noexcept
{
move(std::move(v));
return *this;
diff --git a/src/core/managed/Managed.hpp b/src/core/managed/Managed.hpp
index cb7104b..7c43527 100644
--- a/src/core/managed/Managed.hpp
+++ b/src/core/managed/Managed.hpp
@@ -453,7 +453,7 @@ public:
*
* @param h is the Rooted to be moved to this instance.
*/
- Rooted(Rooted<T> &&h) : Handle<T>(h.ptr) { h.ptr = nullptr; }
+ Rooted(Rooted<T> &&h) noexcept : Handle<T>(h.ptr) { h.ptr = nullptr; }
/**
* Constructor of the Rooted class.
@@ -494,7 +494,7 @@ public:
*
* @param h is the Owned to be moved to this instance.
*/
- Rooted<T> &operator=(Rooted<T> &&h)
+ Rooted<T> &operator=(Rooted<T> &&h) noexcept
{
deleteRef();
this->ptr = h.ptr;
@@ -523,7 +523,7 @@ public:
*
* @param h is the Owned to be moved to this instance.
*/
- Rooted<T> &operator=(Handle<T> &&h)
+ Rooted<T> &operator=(Handle<T> &&h) noexcept
{
deleteRef();
this->ptr = h.ptr;
@@ -600,7 +600,7 @@ public:
*
* @param h is the Owned to be moved to this instance.
*/
- Owned(Owned<T> &&h) : Handle<T>(h.get()), owner(h.getOwner())
+ Owned(Owned<T> &&h) noexcept : Handle<T>(h.get()), owner(h.getOwner())
{
h.ptr = nullptr;
}
@@ -627,7 +627,7 @@ public:
*
* @param h is the Owned to be moved to this instance.
*/
- Owned<T> &operator=(Owned<T> &&h)
+ Owned<T> &operator=(Owned<T> &&h) noexcept
{
deleteRef();
this->ptr = h.ptr;
diff --git a/src/core/managed/ManagedContainer.hpp b/src/core/managed/ManagedContainer.hpp
index f62ba11..35d431b 100644
--- a/src/core/managed/ManagedContainer.hpp
+++ b/src/core/managed/ManagedContainer.hpp
@@ -319,7 +319,7 @@ public:
*
* @param other is the other container that should be moved.
*/
- ManagedContainer(own_type &&other)
+ ManagedContainer(own_type &&other) noexcept
: owner(other.owner), c(std::move(other.c))
{
// other.owner = nullptr;
@@ -408,7 +408,7 @@ public:
* @param other is the collection instance that should be moved;
* @return this instance.
*/
- own_type &operator=(own_type &&other)
+ own_type &operator=(own_type &&other) noexcept
{
finalize();
owner = other.owner;