Commit b81a0416 authored by Milian Wolff's avatar Milian Wolff
Browse files

Add move operations for IndexedInstantiationInformation

The implementation is based on that established already by
IndexedIdentifier.
parent 4b1ac952
......@@ -159,12 +159,25 @@ IndexedInstantiationInformation::IndexedInstantiationInformation(const IndexedIn
ItemRepositoryUtils::inc(this);
}
IndexedInstantiationInformation::IndexedInstantiationInformation(IndexedInstantiationInformation&& rhs) noexcept
: m_index(rhs.m_index)
{
rhs.m_index = standardInstantiationInformationIndex();
}
IndexedInstantiationInformation& IndexedInstantiationInformation::operator=(const IndexedInstantiationInformation& rhs)
{
ItemRepositoryUtils::setIndex(this, m_index, rhs.m_index);
return *this;
}
IndexedInstantiationInformation&
IndexedInstantiationInformation::operator=(IndexedInstantiationInformation&& rhs) noexcept
{
ItemRepositoryUtils::moveIndex(this, m_index, &rhs, rhs.m_index, standardInstantiationInformationIndex());
return *this;
}
IndexedInstantiationInformation::~IndexedInstantiationInformation()
{
ItemRepositoryUtils::dec(this);
......
......@@ -28,7 +28,9 @@ public:
IndexedInstantiationInformation() noexcept = default;
explicit IndexedInstantiationInformation(uint index);
IndexedInstantiationInformation(const IndexedInstantiationInformation& rhs);
IndexedInstantiationInformation(IndexedInstantiationInformation&& rhs) noexcept;
IndexedInstantiationInformation& operator=(const IndexedInstantiationInformation& rhs);
IndexedInstantiationInformation& operator=(IndexedInstantiationInformation&& rhs) noexcept;
~IndexedInstantiationInformation();
const InstantiationInformation& information() const;
......
Supports Markdown
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