From 3ec0036993f745252ed12d6e2490319dc94fc8ed Mon Sep 17 00:00:00 2001 From: caballa Date: Mon, 5 Jun 2023 09:48:27 -0600 Subject: [PATCH] perf: use T&& instead of const T&& We were using const T&& instead of T&& in copy and assignment operators. As part of the commit, I also try to use default as much as possible. Thanks to Enea Zaffanella to point out the problem with move operators --- include/crab/cfg/cfg.hpp | 14 ++---- include/crab/domains/apron_domains.hpp | 15 ++---- include/crab/domains/array_adaptive.hpp | 49 ++++--------------- include/crab/domains/array_smashing.hpp | 2 +- include/crab/domains/boxes.hpp | 10 ++-- include/crab/domains/combined_congruences.hpp | 7 ++- include/crab/domains/combined_domains.hpp | 27 ++++------ include/crab/domains/constant_domain.hpp | 9 +--- include/crab/domains/dis_intervals.hpp | 3 ++ include/crab/domains/elina_domains.hpp | 12 +---- include/crab/domains/flat_boolean_domain.hpp | 43 ++++------------ include/crab/domains/herbrand_domain.hpp | 3 ++ include/crab/domains/intervals.hpp | 8 ++- include/crab/domains/region_domain.hpp | 22 +-------- include/crab/domains/sign_domain.hpp | 9 +--- include/crab/domains/split_dbm.hpp | 5 -- include/crab/domains/term_equiv.hpp | 4 ++ .../crab/domains/wrapped_interval_domain.hpp | 10 +++- lib/array_adaptive_impl.cpp | 9 +--- 19 files changed, 80 insertions(+), 181 deletions(-) diff --git a/include/crab/cfg/cfg.hpp b/include/crab/cfg/cfg.hpp index c2f375b34..f1c8d44b1 100644 --- a/include/crab/cfg/cfg.hpp +++ b/include/crab/cfg/cfg.hpp @@ -3134,10 +3134,6 @@ class function_decl { : m_func_name(o.m_func_name), m_inputs(o.m_inputs), m_outputs(o.m_outputs) {} - function_decl(const this_type &&o) - : m_func_name(std::move(o.m_func_name)), m_inputs(std::move(o.m_inputs)), - m_outputs(std::move(o.m_outputs)) {} - this_type &operator=(const this_type &o) { if (this != &o) { m_func_name = o.m_func_name; @@ -3147,13 +3143,9 @@ class function_decl { return *this; } - this_type &operator=(const this_type &&o) { - m_func_name = std::move(o.m_func_name); - m_inputs = std::move(o.m_inputs); - m_outputs = std::move(o.m_outputs); - return *this; - } - + function_decl(this_type &&o) = default; + this_type &operator=(this_type &&o) = default; + bool operator==(const this_type &o) const { if (m_func_name != o.m_func_name) { return false; diff --git a/include/crab/domains/apron_domains.hpp b/include/crab/domains/apron_domains.hpp index 66c7ebf84..0bab5e654 100644 --- a/include/crab/domains/apron_domains.hpp +++ b/include/crab/domains/apron_domains.hpp @@ -705,8 +705,6 @@ class apron_domain final apPtr(get_man(), (isBot ? ap_abstract0_bottom(get_man(), 0, 0) : ap_abstract0_top(get_man(), 0, 0)))) {} - ~apron_domain() {} - apron_domain(const apron_domain_t &o) : m_apstate( apPtr(get_man(), ap_abstract0_copy(get_man(), &*(o.m_apstate)))), @@ -714,9 +712,6 @@ class apron_domain final APRON_DOMAIN_SCOPED_STATS(".copy"); } - apron_domain(apron_domain_t &&o) - : m_apstate(std::move(o.m_apstate)), m_var_map(std::move(o.m_var_map)) {} - apron_domain_t &operator=(const apron_domain_t &o) { APRON_DOMAIN_SCOPED_STATS(".copy"); if (this != &o) { @@ -727,13 +722,9 @@ class apron_domain final return *this; } - apron_domain_t &operator=(apron_domain_t &&o) { - if (this != &o) { - m_apstate = std::move(o.m_apstate); - m_var_map = std::move(o.m_var_map); - } - return *this; - } + apron_domain(apron_domain_t&& o) = default; + apron_domain_t &operator=(apron_domain_t &&o) = default; + ~apron_domain() = default; apron_domain_t make_top() const override { apron_domain_t out(false); diff --git a/include/crab/domains/array_adaptive.hpp b/include/crab/domains/array_adaptive.hpp index da1310852..dedd41dd5 100644 --- a/include/crab/domains/array_adaptive.hpp +++ b/include/crab/domains/array_adaptive.hpp @@ -358,11 +358,11 @@ class offset_map_t { offset_map_t(const offset_map_t &o); - offset_map_t(const offset_map_t &&o); + offset_map_t(offset_map_t &&o); offset_map_t &operator=(const offset_map_t &o); - offset_map_t &operator=(const offset_map_t &&o); + offset_map_t &operator=(offset_map_t &&o); bool empty() const; @@ -1012,13 +1012,6 @@ class array_adaptive_domain final do_sanity_checks(); } - array_state(const array_state &&o) - : m_is_smashed(std::move(o.m_is_smashed)), - m_element_sz(std::move(o.m_element_sz)), - m_offset_map(std::move(o.m_offset_map)) { - do_sanity_checks(); - } - array_state &operator=(const array_state &o) { if (this != &o) { m_is_smashed = o.m_is_smashed; @@ -1029,15 +1022,8 @@ class array_adaptive_domain final return *this; } - array_state &operator=(const array_state &&o) { - if (this != &o) { - m_is_smashed = std::move(o.m_is_smashed); - m_element_sz = std::move(o.m_element_sz); - m_offset_map = std::move(o.m_offset_map); - } - do_sanity_checks(); - return *this; - } + array_state(array_state &&o) = default; + array_state &operator=(array_state &&o) = default; /*** begin mergeable_map API ***/ array_state join(const variable_t &v, const array_state &o, @@ -1255,9 +1241,6 @@ class array_adaptive_domain final array_state_map_t(const array_state_map_t &o) : m_tree(o.m_tree) {} - array_state_map_t(const array_state_map_t &&o) - : m_tree(std::move(o.m_tree)) {} - array_state_map_t &operator=(const array_state_map_t &o) { if (this != &o) { m_tree = o.m_tree; @@ -1265,12 +1248,8 @@ class array_adaptive_domain final return *this; } - array_state_map_t &operator=(const array_state_map_t &&o) { - if (this != &o) { - m_tree = std::move(o.m_tree); - } - return *this; - } + array_state_map_t(array_state_map_t&& o) = default; + array_state_map_t& operator=(array_state_map_t&& o) = default; iterator begin() const { return m_tree.begin(); } @@ -1727,10 +1706,6 @@ class array_adaptive_domain final ARRAY_ADAPTIVE_DOMAIN_SCOPED_STATS(".copy"); } - array_adaptive_domain(const array_adaptive_domain_t &&other) - : m_base_dom(std::move(other.m_base_dom)), - m_array_map(std::move(other.m_array_map)), - m_cell_ghost_man(std::move(other.m_cell_ghost_man)) {} array_adaptive_domain_t &operator=(const array_adaptive_domain_t &other) { ARRAY_ADAPTIVE_DOMAIN_SCOPED_STATS(".copy"); @@ -1742,14 +1717,8 @@ class array_adaptive_domain final return *this; } - array_adaptive_domain_t &operator=(const array_adaptive_domain_t &&other) { - if (this != &other) { - m_base_dom = std::move(other.m_base_dom); - m_array_map = std::move(other.m_array_map); - m_cell_ghost_man = std::move(other.m_cell_ghost_man); - } - return *this; - } + array_adaptive_domain(array_adaptive_domain_t &&other) = default; + array_adaptive_domain_t &operator=(array_adaptive_domain_t &&other) = default; bool is_bottom() const override { return (m_base_dom.is_bottom()); } @@ -1781,7 +1750,7 @@ class array_adaptive_domain final } } - bool operator==(array_adaptive_domain_t other) { + bool operator==(const array_adaptive_domain_t &other) { return (m_base_dom <= other.m_base_dom && other.m_base_dom <= m_base_dom); } diff --git a/include/crab/domains/array_smashing.hpp b/include/crab/domains/array_smashing.hpp index 4ee3ff949..3e5272805 100644 --- a/include/crab/domains/array_smashing.hpp +++ b/include/crab/domains/array_smashing.hpp @@ -246,7 +246,6 @@ class array_smashing final ARRAY_SMASHING_DOMAIN_SCOPED_STATS(".copy"); } - array_smashing(array_smashing_t &&other) = default; array_smashing_t &operator=(const array_smashing_t &other) { ARRAY_SMASHING_DOMAIN_SCOPED_STATS(".copy"); @@ -257,6 +256,7 @@ class array_smashing final return *this; } + array_smashing(array_smashing_t &&other) = default; array_smashing_t &operator=(array_smashing_t &&other) = default; bool is_bottom() const override { return m_base_dom.is_bottom(); } diff --git a/include/crab/domains/boxes.hpp b/include/crab/domains/boxes.hpp index abc81987b..c637f04ca 100644 --- a/include/crab/domains/boxes.hpp +++ b/include/crab/domains/boxes.hpp @@ -810,9 +810,7 @@ class boxes_domain final m_ldd(lddPtr(get_ldd_man(), &(*other.m_ldd))) { BOXES_DOMAIN_SCOPED_STATS(".copy"); } - - boxes_domain(boxes_domain_t &&other) : m_ldd(std::move(other.m_ldd)) {} - + boxes_domain_t &operator=(const boxes_domain_t &other) { BOXES_DOMAIN_SCOPED_STATS(".copy"); if (this != &other) { @@ -822,6 +820,12 @@ class boxes_domain final return *this; } + boxes_domain(boxes_domain_t &&other) : m_ldd(std::move(other.m_ldd)) {} + boxes_domain_t &operator=(boxes_domain_t &&other) { + m_ldd = std::move(other.m_ldd); + return *this; + } + bool is_bottom() const override { return &*m_ldd == Ldd_GetFalse(get_ldd_man()); } diff --git a/include/crab/domains/combined_congruences.hpp b/include/crab/domains/combined_congruences.hpp index be98fe9a3..a1f2d67f0 100644 --- a/include/crab/domains/combined_congruences.hpp +++ b/include/crab/domains/combined_congruences.hpp @@ -131,12 +131,15 @@ class numerical_congruence_domain final : m_product(other.m_product) {} rnc_domain_t &operator=(const rnc_domain_t &other) { - if (this != &other) + if (this != &other) { m_product = other.m_product; - + } return *this; } + numerical_congruence_domain(rnc_domain_t &&other) = default; + rnc_domain_t &operator=(rnc_domain_t &&other) = default; + bool is_bottom() const override { return m_product.is_bottom(); } bool is_top() const override { return m_product.is_top(); } diff --git a/include/crab/domains/combined_domains.hpp b/include/crab/domains/combined_domains.hpp index 5fc09581e..d4028cda6 100644 --- a/include/crab/domains/combined_domains.hpp +++ b/include/crab/domains/combined_domains.hpp @@ -353,20 +353,18 @@ class reduced_domain_product2 final reduced_domain_product2(const reduced_domain_product2_t &other) : m_product(other.m_product) {} - reduced_domain_product2(const reduced_domain_product2_t &&other) + reduced_domain_product2(reduced_domain_product2_t &&other) : m_product(std::move(other.m_product)) {} reduced_domain_product2_t &operator=(const reduced_domain_product2_t &other) { - if (this != &other) + if (this != &other) { m_product = other.m_product; + } return *this; } - reduced_domain_product2_t &operator=(const reduced_domain_product2_t &&other) { - if (this != &other) - m_product = std::move(other.m_product); - return *this; - } + reduced_domain_product2_t& + operator=(reduced_domain_product2_t&& o) = default; bool is_bottom() const override { return m_product.is_bottom(); } @@ -1186,10 +1184,8 @@ class reduced_numerical_domain_product2 final : m_product(other.m_product) {} reduced_numerical_domain_product2( - reduced_numerical_domain_product2_t &&other) - : m_product(std::move(other.m_product)) {} + reduced_numerical_domain_product2_t&& other) = default; - reduced_numerical_domain_product2_t & operator=(const reduced_numerical_domain_product2_t &other) { if (this != &other) { @@ -1198,14 +1194,9 @@ class reduced_numerical_domain_product2 final return *this; } - reduced_numerical_domain_product2_t & - operator=(reduced_numerical_domain_product2_t &&other) { - if (this != &other) { - m_product = std::move(other.m_product); - } - return *this; - } - + reduced_numerical_domain_product2_t& + operator=(reduced_numerical_domain_product2_t&& other) = default; + bool is_bottom() const override { return m_product.is_bottom(); } bool is_top() const override { return m_product.is_top(); } diff --git a/include/crab/domains/constant_domain.hpp b/include/crab/domains/constant_domain.hpp index 6e8668269..c4602b667 100644 --- a/include/crab/domains/constant_domain.hpp +++ b/include/crab/domains/constant_domain.hpp @@ -177,7 +177,6 @@ class constant_domain final : public crab::domains::abstract_domain_api< CONSTANT_DOMAIN_SCOPED_STATS(".copy"); } - constant_domain(constant_domain_t &&e) : m_env(std::move(e.m_env)) {} constant_domain_t &operator=(const constant_domain_t &o) { CONSTANT_DOMAIN_SCOPED_STATS(".copy"); @@ -187,12 +186,8 @@ class constant_domain final : public crab::domains::abstract_domain_api< return *this; } - constant_domain_t &operator=(constant_domain_t &&o) { - if (this != &o) { - m_env = std::move(o.m_env); - } - return *this; - } + constant_domain(constant_domain_t &&o) = default; + constant_domain_t &operator=(constant_domain_t &&o) = default; constant_t get_constant(const variable_t &v) const { return m_env.at(v); } diff --git a/include/crab/domains/dis_intervals.hpp b/include/crab/domains/dis_intervals.hpp index b9ddcf4c0..c90f66f62 100644 --- a/include/crab/domains/dis_intervals.hpp +++ b/include/crab/domains/dis_intervals.hpp @@ -1149,6 +1149,9 @@ class dis_interval_domain final return *this; } + dis_interval_domain(dis_interval_domain_t &&o) = default; + dis_interval_domain_t &operator=(dis_interval_domain_t &&o) = default; + bool is_bottom() const override { return this->_env.is_bottom(); } bool is_top() const override { return this->_env.is_top(); } diff --git a/include/crab/domains/elina_domains.hpp b/include/crab/domains/elina_domains.hpp index b167ea34d..ea605df90 100644 --- a/include/crab/domains/elina_domains.hpp +++ b/include/crab/domains/elina_domains.hpp @@ -937,9 +937,6 @@ class elina_domain final ELINA_DOMAIN_SCOPED_STATS(".copy"); } - elina_domain(elina_domain_t &&o) - : m_apstate(std::move(o.m_apstate)), m_var_map(std::move(o.m_var_map)) {} - elina_domain_t &operator=(const elina_domain_t &o) { ELINA_DOMAIN_SCOPED_STATS(".copy"); if (this != &o) { @@ -950,13 +947,8 @@ class elina_domain final return *this; } - elina_domain_t &operator=(elina_domain_t &&o) { - if (this != &o) { - m_apstate = std::move(o.m_apstate); - m_var_map = std::move(o.m_var_map); - } - return *this; - } + elina_domain(elina_domain_t &&o) = default; + elina_domain_t &operator=(elina_domain_t &&o) = default; elina_domain_t make_top() const override { elina_domain_t out(false); diff --git a/include/crab/domains/flat_boolean_domain.hpp b/include/crab/domains/flat_boolean_domain.hpp index 55b47c36e..3ac335360 100644 --- a/include/crab/domains/flat_boolean_domain.hpp +++ b/include/crab/domains/flat_boolean_domain.hpp @@ -88,11 +88,15 @@ class flat_boolean_domain final flat_boolean_domain_t &operator=(const flat_boolean_domain_t &o) { BOOL_DOMAIN_SCOPED_STATS(".copy"); - if (this != &o) + if (this != &o) { m_env = o.m_env; + } return *this; } + flat_boolean_domain(flat_boolean_domain_t&& o) = default; + flat_boolean_domain_t& operator=(flat_boolean_domain_t&& o) = default; + iterator begin() { if (is_bottom()) CRAB_ERROR("Cannot return iterator from bottom"); @@ -966,40 +970,11 @@ class flat_boolean_numerical_domain final : m_product(), m_bool_to_lincsts(), m_bool_to_refcsts(), m_bool_to_bools(), m_unchanged_vars() {} - flat_boolean_numerical_domain(const bool_num_domain_t &other) - : m_product(other.m_product), m_bool_to_lincsts(other.m_bool_to_lincsts), - m_bool_to_refcsts(other.m_bool_to_refcsts), - m_bool_to_bools(other.m_bool_to_bools), - m_unchanged_vars(other.m_unchanged_vars) {} - - flat_boolean_numerical_domain(const bool_num_domain_t &&other) - : m_product(std::move(other.m_product)), - m_bool_to_lincsts(std::move(other.m_bool_to_lincsts)), - m_bool_to_refcsts(std::move(other.m_bool_to_refcsts)), - m_bool_to_bools(std::move(other.m_bool_to_bools)), - m_unchanged_vars(std::move(other.m_unchanged_vars)) {} - - bool_num_domain_t &operator=(const bool_num_domain_t &other) { - if (this != &other) { - m_product = other.m_product; - m_bool_to_lincsts = other.m_bool_to_lincsts; - m_bool_to_refcsts = other.m_bool_to_refcsts; - m_bool_to_bools = other.m_bool_to_bools; - m_unchanged_vars = other.m_unchanged_vars; - } - return *this; - } + flat_boolean_numerical_domain(const bool_num_domain_t &other) = default; + bool_num_domain_t &operator=(const bool_num_domain_t &other) = default; - bool_num_domain_t &operator=(const bool_num_domain_t &&other) { - if (this != &other) { - m_product = std::move(other.m_product); - m_bool_to_lincsts = std::move(other.m_bool_to_lincsts); - m_bool_to_refcsts = std::move(other.m_bool_to_refcsts); - m_bool_to_bools = std::move(other.m_bool_to_bools); - m_unchanged_vars = std::move(other.m_unchanged_vars); - } - return *this; - } + flat_boolean_numerical_domain(bool_num_domain_t &&other) = default; + bool_num_domain_t& operator=(bool_num_domain_t &&other) = default; bool is_bottom() const override { return m_product.is_bottom(); } diff --git a/include/crab/domains/herbrand_domain.hpp b/include/crab/domains/herbrand_domain.hpp index 2e60ba43e..a7bd2cc5a 100644 --- a/include/crab/domains/herbrand_domain.hpp +++ b/include/crab/domains/herbrand_domain.hpp @@ -436,6 +436,9 @@ class herbrand_domain final check_terms(__LINE__); return *this; } + + herbrand_domain(herbrand_domain_t &&o) = default; + herbrand_domain_t &operator=(herbrand_domain_t &&o) = default; bool is_bottom() const override { return m_is_bottom; } diff --git a/include/crab/domains/intervals.hpp b/include/crab/domains/intervals.hpp index eeb035ca2..785271716 100644 --- a/include/crab/domains/intervals.hpp +++ b/include/crab/domains/intervals.hpp @@ -163,17 +163,21 @@ class interval_domain final interval_domain() : _env(separate_domain_t::top()) {} - interval_domain(const interval_domain_t &e) : _env(e._env) { + interval_domain(const interval_domain_t &o) : _env(o._env) { INTERVALS_DOMAIN_SCOPED_STATS(".copy"); } interval_domain_t &operator=(const interval_domain_t &o) { INTERVALS_DOMAIN_SCOPED_STATS(".copy"); - if (this != &o) + if (this != &o) { this->_env = o._env; + } return *this; } + interval_domain(interval_domain_t &&o) = default; + interval_domain_t &operator=(interval_domain_t &&o) = default; + iterator begin() { return this->_env.begin(); } iterator end() { return this->_env.end(); } diff --git a/include/crab/domains/region_domain.hpp b/include/crab/domains/region_domain.hpp index 8589c9daa..c6b826526 100644 --- a/include/crab/domains/region_domain.hpp +++ b/include/crab/domains/region_domain.hpp @@ -678,14 +678,6 @@ class region_domain final : public abstract_domain_api> { m_rgn_equiv_classes(o.m_rgn_equiv_classes) { REGION_DOMAIN_SCOPED_STATS(".copy"); } - region_domain(region_domain_t &&o) - : m_is_bottom(o.m_is_bottom), - m_ghost_var_man(std::move(o.m_ghost_var_man)), - m_base_dom(std::move(o.m_base_dom)), - m_rgn_env(std::move(o.m_rgn_env)), - m_tag_env(std::move(o.m_tag_env)), - m_alloc_env(std::move(o.m_alloc_env)), - m_rgn_equiv_classes(std::move(o.m_rgn_equiv_classes)) {} region_domain_t &operator=(const region_domain_t &o) { REGION_DOMAIN_SCOPED_STATS(".copy"); @@ -701,18 +693,8 @@ class region_domain final : public abstract_domain_api> { return *this; } - region_domain_t &operator=(region_domain_t &&o) { - if (this != &o) { - m_is_bottom = std::move(o.m_is_bottom); - m_ghost_var_man = std::move(o.m_ghost_var_man); - m_base_dom = std::move(o.m_base_dom); - m_rgn_env = std::move(o.m_rgn_env); - m_tag_env = std::move(o.m_tag_env); - m_alloc_env = std::move(o.m_alloc_env); - m_rgn_equiv_classes = std::move(o.m_rgn_equiv_classes); - } - return *this; - } + region_domain(region_domain_t &&o) = default; + region_domain_t &operator=(region_domain_t &&o) = default; bool is_bottom() const override { return m_is_bottom; } diff --git a/include/crab/domains/sign_domain.hpp b/include/crab/domains/sign_domain.hpp index 88e013078..5ce90cefa 100644 --- a/include/crab/domains/sign_domain.hpp +++ b/include/crab/domains/sign_domain.hpp @@ -306,7 +306,6 @@ class sign_domain final : public crab::domains::abstract_domain_api< SIGN_DOMAIN_SCOPED_STATS(".copy"); } - sign_domain(sign_domain_t &&e) : m_env(std::move(e.m_env)) {} sign_domain_t &operator=(const sign_domain_t &o) { SIGN_DOMAIN_SCOPED_STATS(".copy"); @@ -316,12 +315,8 @@ class sign_domain final : public crab::domains::abstract_domain_api< return *this; } - sign_domain_t &operator=(sign_domain_t &&o) { - if (this != &o) { - m_env = std::move(o.m_env); - } - return *this; - } + sign_domain(sign_domain_t &&o) = default; + sign_domain_t &operator=(sign_domain_t &&o) = default; bool is_bottom() const override { return m_env.is_bottom(); } diff --git a/include/crab/domains/split_dbm.hpp b/include/crab/domains/split_dbm.hpp index 7c8ec0b00..3e481d70d 100644 --- a/include/crab/domains/split_dbm.hpp +++ b/include/crab/domains/split_dbm.hpp @@ -1311,7 +1311,6 @@ class split_dbm_domain final : vert_map(o.vert_map), rev_map(o.rev_map), g(o.g), potential(o.potential), unstable(o.unstable), _is_bottom(false) { SPLIT_DBM_DOMAIN_SCOPED_STATS(".copy"); - CRAB_LOG("zones-split-size", auto p = size(); print_dbm_size(p.first, p.second)); @@ -1327,12 +1326,10 @@ class split_dbm_domain final : vert_map(std::move(o.vert_map)), rev_map(std::move(o.rev_map)), g(std::move(o.g)), potential(std::move(o.potential)), unstable(std::move(o.unstable)), _is_bottom(o._is_bottom) { - SPLIT_DBM_DOMAIN_SCOPED_STATS(".copy"); } split_dbm_domain &operator=(const split_dbm_domain &o) { SPLIT_DBM_DOMAIN_SCOPED_STATS(".copy"); - if (this != &o) { if (o._is_bottom) { set_to_bottom(); @@ -1355,8 +1352,6 @@ class split_dbm_domain final } split_dbm_domain &operator=(split_dbm_domain &&o) { - SPLIT_DBM_DOMAIN_SCOPED_STATS(".copy"); - if (o._is_bottom) { set_to_bottom(); } else { diff --git a/include/crab/domains/term_equiv.hpp b/include/crab/domains/term_equiv.hpp index 633bb9a40..5f10d178f 100644 --- a/include/crab/domains/term_equiv.hpp +++ b/include/crab/domains/term_equiv.hpp @@ -747,6 +747,10 @@ class term_domain final : public abstract_domain_api_env = o._env; + } return *this; } + wrapped_interval_domain(wrapped_interval_domain_t &&o) = default; + + wrapped_interval_domain_t &operator=(wrapped_interval_domain_t &&o) = default; + + iterator begin() { return this->_env.begin(); } iterator end() { return this->_env.end(); } @@ -1030,7 +1036,7 @@ class wrapped_interval_with_history_domain final : _w_int_dom(o._w_int_dom), _limit_env(o._limit_env), _init_set(o._init_set) {} - wrapped_interval_with_history_domain(const this_type &&o) + wrapped_interval_with_history_domain(this_type &&o) : _w_int_dom(std::move(o._w_int_dom)), _limit_env(std::move(o._limit_env)), _init_set(std::move(o._init_set)) { } diff --git a/lib/array_adaptive_impl.cpp b/lib/array_adaptive_impl.cpp index 8fa3bab27..459ea8ddc 100644 --- a/lib/array_adaptive_impl.cpp +++ b/lib/array_adaptive_impl.cpp @@ -337,7 +337,7 @@ offset_map_t::offset_map_t() {} offset_map_t::offset_map_t(const offset_map_t &o) : m_map(o.m_map) {} -offset_map_t::offset_map_t(const offset_map_t &&o) +offset_map_t::offset_map_t(offset_map_t &&o) : m_map(std::move(o.m_map)) {} offset_map_t &offset_map_t::operator=(const offset_map_t &o) { @@ -347,12 +347,7 @@ offset_map_t &offset_map_t::operator=(const offset_map_t &o) { return *this; } -offset_map_t &offset_map_t::operator=(const offset_map_t &&o) { - if (this != &o) { - m_map = std::move(o.m_map); - } - return *this; -} +offset_map_t& offset_map_t::operator=(offset_map_t&& o) = default; bool offset_map_t::empty() const { return m_map.empty(); }