Browse Source

PropertiesIteratorView: Move move operators to cpp-file and use rule of five.

Michael Ragazzon 6 years ago
parent
commit
68f23e5e8e

+ 5 - 2
Include/RmlUi/Core/PropertiesIteratorView.h

@@ -52,8 +52,10 @@ class PropertiesIterator;
 class RMLUICORE_API PropertiesIteratorView {
 public:
 	PropertiesIteratorView(std::unique_ptr<PropertiesIterator> ptr);
-	PropertiesIteratorView(PropertiesIteratorView&&) = default;
-	PropertiesIteratorView& operator=(PropertiesIteratorView&&) = default;
+	PropertiesIteratorView(PropertiesIteratorView&& other);
+	PropertiesIteratorView& operator=(PropertiesIteratorView&& other);
+	PropertiesIteratorView(const PropertiesIteratorView& other) = delete;
+	PropertiesIteratorView& operator=(const PropertiesIteratorView&) = delete;
 	~PropertiesIteratorView();
 
 	PropertiesIteratorView& operator++();
@@ -67,6 +69,7 @@ public:
 	const Property& GetProperty() const;
 
 	// Returns the list of pseudo classes which defines the current property, possibly empty.
+	// @todo Currently returns an empty list.
 	const PseudoClassList& GetPseudoClassList() const;
 
 private:

+ 0 - 1
Source/Core/PropertiesIterator.h

@@ -30,7 +30,6 @@
 
 #include "../../Include/RmlUi/Core/Types.h"
 #include "DirtyPropertyList.h"
-#include "ElementDefinition.h"
 
 namespace Rml {
 namespace Core {

+ 8 - 0
Source/Core/PropertiesIteratorView.cpp

@@ -37,6 +37,14 @@ namespace Core {
 
 PropertiesIteratorView::PropertiesIteratorView(std::unique_ptr<PropertiesIterator> ptr) : ptr(std::move(ptr)) {}
 
+PropertiesIteratorView::PropertiesIteratorView(PropertiesIteratorView&& other) : ptr(std::move(other.ptr)) {}
+
+PropertiesIteratorView& PropertiesIteratorView::operator=(PropertiesIteratorView&& other) 
+{
+	ptr = std::move(other.ptr);
+	return *this;
+}
+
 PropertiesIteratorView::~PropertiesIteratorView()
 {}