mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4726 from ethereum/moveNothrow
Make MemberList nothrow move constructible.
This commit is contained in:
commit
c61cc98d0d
@ -169,15 +169,6 @@ pair<u256, unsigned> const* StorageOffsets::offset(size_t _index) const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
MemberList& MemberList::operator=(MemberList&& _other)
|
|
||||||
{
|
|
||||||
solAssert(&_other != this, "");
|
|
||||||
|
|
||||||
m_memberTypes = move(_other.m_memberTypes);
|
|
||||||
m_storageOffsets = move(_other.m_storageOffsets);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MemberList::combine(MemberList const & _other)
|
void MemberList::combine(MemberList const & _other)
|
||||||
{
|
{
|
||||||
m_memberTypes += _other.m_memberTypes;
|
m_memberTypes += _other.m_memberTypes;
|
||||||
|
@ -95,9 +95,7 @@ public:
|
|||||||
|
|
||||||
using MemberMap = std::vector<Member>;
|
using MemberMap = std::vector<Member>;
|
||||||
|
|
||||||
MemberList() {}
|
|
||||||
explicit MemberList(MemberMap const& _members): m_memberTypes(_members) {}
|
explicit MemberList(MemberMap const& _members): m_memberTypes(_members) {}
|
||||||
MemberList& operator=(MemberList&& _other);
|
|
||||||
void combine(MemberList const& _other);
|
void combine(MemberList const& _other);
|
||||||
TypePointer memberType(std::string const& _name) const
|
TypePointer memberType(std::string const& _name) const
|
||||||
{
|
{
|
||||||
@ -132,6 +130,8 @@ private:
|
|||||||
mutable std::unique_ptr<StorageOffsets> m_storageOffsets;
|
mutable std::unique_ptr<StorageOffsets> m_storageOffsets;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static_assert(std::is_nothrow_move_constructible<MemberList>::value, "MemberList should be noexcept move constructible");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract base class that forms the root of the type hierarchy.
|
* Abstract base class that forms the root of the type hierarchy.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user