diff options
author | 2021-07-14 17:16:36 +0100 | |
---|---|---|
committer | 2021-07-16 09:44:43 +0000 | |
commit | 8f21748bf127012947ed48c40948df3f2d9c85ef (patch) | |
tree | 70d287634fd0b3a2d43ad8de7738c9703eb0a2a6 /libartbase/base/variant_map.h | |
parent | ce5c830aede3313ceb22f7b2ca6c30e5b8432972 (diff) |
Mark move constructors/assignements as `noexcept`.
And unmark `HashSet` copy constructor and copy assignment.
Test: m
Change-Id: Ia419f3036b2880815be446395e81c7e543388bd9
Diffstat (limited to 'libartbase/base/variant_map.h')
-rw-r--r-- | libartbase/base/variant_map.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libartbase/base/variant_map.h b/libartbase/base/variant_map.h index 7349bbc046..4244c9f553 100644 --- a/libartbase/base/variant_map.h +++ b/libartbase/base/variant_map.h @@ -125,7 +125,7 @@ struct VariantMapKeyRaw { protected: // Avoid the object slicing problem; use Clone() instead. VariantMapKeyRaw(const VariantMapKeyRaw&) = default; - VariantMapKeyRaw(VariantMapKeyRaw&&) = default; + VariantMapKeyRaw(VariantMapKeyRaw&&) noexcept = default; private: size_t key_counter_; // Runtime type ID. Unique each time a new type is reified. @@ -179,7 +179,7 @@ struct VariantMapKey : detail::VariantMapKeyRaw { } VariantMapKey(const VariantMapKey&) = default; - VariantMapKey(VariantMapKey&&) = default; + VariantMapKey(VariantMapKey&&) noexcept = default; template <typename Base, template <typename TV> class TKey> friend struct VariantMap; @@ -372,12 +372,12 @@ struct VariantMap { } // Create a new map by moving an existing map into this one. The other map becomes empty. - VariantMap(VariantMap&& other) { + VariantMap(VariantMap&& other) noexcept { operator=(std::forward<VariantMap>(other)); } // Move the existing map's key/value pairs into this one. The other map becomes empty. - VariantMap& operator=(VariantMap&& other) { + VariantMap& operator=(VariantMap&& other) noexcept { if (this != &other) { Clear(); storage_map_.swap(other.storage_map_); |