Commit f0092266 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'Dir-constructors'

25b61c12

 Directory: make it move constructible and assignable
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !171
parents 6af2e592 25b61c12
......@@ -35,6 +35,18 @@ Directory::Directory()
this->Internal = new DirectoryInternals;
}
Directory::Directory(Directory&& other)
{
this->Internal = other.Internal;
other.Internal = nullptr;
}
Directory& Directory::operator=(Directory&& other)
{
std::swap(this->Internal, other.Internal);
return *this;
}
Directory::~Directory()
{
delete this->Internal;
......
......@@ -23,6 +23,11 @@ class @KWSYS_NAMESPACE@_EXPORT Directory
{
public:
Directory();
Directory(Directory&& other);
Directory(const Directory&) = delete;
Directory& operator=(const Directory&) = delete;
Directory& operator=(Directory&& other);
bool operator==(const Directory&) = delete;
~Directory();
/**
......@@ -62,10 +67,7 @@ public:
private:
// Private implementation details.
DirectoryInternals* Internal;
Directory(const Directory&); // Not implemented.
void operator=(const Directory&); // Not implemented.
}; // End Class: Directory
}; // End Class: Directory
} // namespace @KWSYS_NAMESPACE@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment