diff --git a/src/addon/validation.cpp b/src/addon/validation.cpp index 597f0786f91..e4dbf216aac 100644 --- a/src/addon/validation.cpp +++ b/src/addon/validation.cpp @@ -183,7 +183,7 @@ bool check_case_insensitive_duplicates_internal(const config& dir, const std::st const config::attribute_value &filename = path["name"]; const std::string lowercase = boost::algorithm::to_lower_copy(filename.str(), std::locale::classic()); const std::string with_prefix = prefix + filename.str(); - std::tie(std::ignore, inserted) = filenames.emplace(lowercase, std::make_pair(false, with_prefix)); + std::tie(std::ignore, inserted) = filenames.emplace(lowercase, std::pair(false, with_prefix)); if (!inserted){ if(badlist){ std::tie(printed, original) = filenames[lowercase]; @@ -201,7 +201,7 @@ bool check_case_insensitive_duplicates_internal(const config& dir, const std::st const config::attribute_value &filename = path["name"]; const std::string lowercase = boost::algorithm::to_lower_copy(filename.str(), std::locale::classic()); const std::string with_prefix = prefix + filename.str(); - std::tie(std::ignore, inserted) = filenames.emplace(lowercase, std::make_pair(false, with_prefix)); + std::tie(std::ignore, inserted) = filenames.emplace(lowercase, std::pair(false, with_prefix)); if (!inserted) { if(badlist){ std::tie(printed, original) = filenames[lowercase]; diff --git a/src/ai/default/attack.cpp b/src/ai/default/attack.cpp index f8d3dbffffe..4e6d1c6faab 100644 --- a/src/ai/default/attack.cpp +++ b/src/ai/default/attack.cpp @@ -125,7 +125,7 @@ void attack_analysis::analyze(const gamemap& map, unit_map& units, // This cache is only about 99% correct, but speeds up evaluation by about 1000 times. // We recalculate when we actually attack. - const readonly_context::unit_stats_cache_t::key_type cache_key = std::make_pair(target, &up->type()); + const readonly_context::unit_stats_cache_t::key_type cache_key = std::pair(target, &up->type()); const readonly_context::unit_stats_cache_t::iterator usc = ai_obj.unit_stats_cache().find(cache_key); // Just check this attack is valid for this attacking unit (may be modified) if (usc != ai_obj.unit_stats_cache().end() && @@ -146,7 +146,7 @@ void attack_analysis::analyze(const gamemap& map, unit_map& units, old_bc.reset(nullptr); if ( !from_cache ) { - ai_obj.unit_stats_cache().emplace(cache_key, std::make_pair( + ai_obj.unit_stats_cache().emplace(cache_key, std::pair( bc->get_attacker_stats(), bc->get_defender_stats() )); diff --git a/src/ai/default/ca_move_to_targets.cpp b/src/ai/default/ca_move_to_targets.cpp index aca0b7ee6c6..5ebab77f565 100644 --- a/src/ai/default/ca_move_to_targets.cpp +++ b/src/ai/default/ca_move_to_targets.cpp @@ -270,7 +270,7 @@ std::pair move_to_targets_phase::choose_move(std::vec if (!(u->side() != get_side() || (u->can_recruit() && !is_keep_ignoring_leader(u->id())) || u->movement_left() <= 0 || u->incapacitated())) { if (u->get_state("guardian")) { LOG_AI << u->type_id() << " is guardian, staying still\n"; - return std::make_pair(u->get_location(), u->get_location()); + return std::pair(u->get_location(), u->get_location()); } } } @@ -363,7 +363,7 @@ std::pair move_to_targets_phase::choose_move(std::vec if(best_rated_target == rated_targets.end()) { LOG_AI << "no eligible targets found for unit at " << u->get_location() << std::endl; - return std::make_pair(u->get_location(), u->get_location()); + return std::pair(u->get_location(), u->get_location()); } assert(best_rating >= 0); @@ -446,7 +446,7 @@ std::pair move_to_targets_phase::choose_move(std::vec } LOG_AI << "returning support...\n"; - return std::make_pair(best->get_location(), best_loc); + return std::pair(best->get_location(), best_loc); } } @@ -503,7 +503,7 @@ std::pair move_to_targets_phase::choose_move(std::vec LOG_AI << "group didn't move " << group.size() << "\n"; //the group didn't move, so end the first unit in the group's turn, to prevent an infinite loop - return std::make_pair(best->get_location(), best->get_location()); + return std::pair(best->get_location(), best->get_location()); } } else { @@ -604,7 +604,7 @@ std::pair move_to_targets_phase::choose_move(std::vec //create this as a target, attempting to rally units around targets.emplace_back(best->get_location(), best_target->value); best_target = targets.end() - 1; - return std::make_pair(best->get_location(), best->get_location()); + return std::pair(best->get_location(), best->get_location()); } LOG_AI << "Could not find anywhere to move!\n"; diff --git a/src/ai/formula/function_table.cpp b/src/ai/formula/function_table.cpp index da62f542021..b64e529eaec 100644 --- a/src/ai/formula/function_table.cpp +++ b/src/ai/formula/function_table.cpp @@ -1040,7 +1040,7 @@ namespace { } } - return std::make_pair(highest_melee_damage, highest_ranged_damage); + return std::pair(highest_melee_damage, highest_ranged_damage); } } diff --git a/src/commandline_options.cpp b/src/commandline_options.cpp index 85a7558288f..ece3245c50f 100644 --- a/src/commandline_options.cpp +++ b/src/commandline_options.cpp @@ -569,7 +569,7 @@ void commandline_options::parse_resolution_ ( const std::string& resolution_stri throw bad_commandline_resolution(resolution_string); } - resolution = std::make_pair(xres, yres); + resolution = std::pair(xres, yres); } std::vector> commandline_options::parse_to_uint_string_tuples_(const std::vector &strings, char separator) diff --git a/src/editor/controller/editor_controller.cpp b/src/editor/controller/editor_controller.cpp index 5d7cebb6022..0bb843ebee3 100644 --- a/src/editor/controller/editor_controller.cpp +++ b/src/editor/controller/editor_controller.cpp @@ -123,7 +123,7 @@ void editor_controller::init_tods(const game_config_view& game_config) tods_map::iterator times = tods_.find(schedule_id); if (times == tods_.end()) { std::pair new_times = - tods_.emplace(schedule_id, std::make_pair(schedule_name, std::vector())); + tods_.emplace(schedule_id, std::pair(schedule_name, std::vector())); times = new_times.first; } else { diff --git a/src/filesystem_sdl.cpp b/src/filesystem_sdl.cpp index 5337cfd3a9d..8af2ef9b8b8 100644 --- a/src/filesystem_sdl.cpp +++ b/src/filesystem_sdl.cpp @@ -116,11 +116,11 @@ typedef std::pair offset_dir; static offset_dir translate_seekdir(int64_t offset, int whence) { switch(whence){ case RW_SEEK_SET: - return std::make_pair(std::max(0, offset), std::ios_base::beg); + return std::pair(std::max(0, offset), std::ios_base::beg); case RW_SEEK_CUR: - return std::make_pair(offset, std::ios_base::cur); + return std::pair(offset, std::ios_base::cur); case RW_SEEK_END: - return std::make_pair(std::min(0, offset), std::ios_base::end); + return std::pair(std::min(0, offset), std::ios_base::end); default: assert(false); throw "assertion ignored"; diff --git a/src/gui/core/placer/horizontal_list.cpp b/src/gui/core/placer/horizontal_list.cpp index 1ece9b76d17..cdbc62655cb 100644 --- a/src/gui/core/placer/horizontal_list.cpp +++ b/src/gui/core/placer/horizontal_list.cpp @@ -30,7 +30,7 @@ namespace implementation placer_horizontal_list::placer_horizontal_list(const unsigned maximum_rows) : maximum_rows_(maximum_rows) , rows_(maximum_rows, 0) - , columns_(1, std::make_pair(0, 0)) + , columns_(1, std::pair(0, 0)) , row_(0) , column_(0) { diff --git a/src/gui/core/placer/vertical_list.cpp b/src/gui/core/placer/vertical_list.cpp index 8fdb9f3f377..4de8d7e37a9 100644 --- a/src/gui/core/placer/vertical_list.cpp +++ b/src/gui/core/placer/vertical_list.cpp @@ -29,7 +29,7 @@ namespace implementation placer_vertical_list::placer_vertical_list(const unsigned maximum_columns) : maximum_columns_(maximum_columns) - , rows_(1, std::make_pair(0, 0)) + , rows_(1, std::pair(0, 0)) , columns_(maximum_columns, 0) , row_(0) , column_(0) diff --git a/src/gui/dialogs/chat_log.cpp b/src/gui/dialogs/chat_log.cpp index 501d339e733..ee775347cfd 100644 --- a/src/gui/dialogs/chat_log.cpp +++ b/src/gui/dialogs/chat_log.cpp @@ -277,7 +277,7 @@ public: LOG_CHAT_LOG << "First " << first << ", last " << last << '\n'; - return std::make_pair(first, last); + return std::pair(first, last); } void update_view_from_model(bool select_last_page = false) diff --git a/src/gui/widgets/addon_list.cpp b/src/gui/widgets/addon_list.cpp index 285705a87d0..10721a1491a 100644 --- a/src/gui/widgets/addon_list.cpp +++ b/src/gui/widgets/addon_list.cpp @@ -385,7 +385,7 @@ void addon_list::finalize_setup() list.register_sorting_option(3, [this](const int i) { return addon_vector_[i]->downloads; }); list.register_translatable_sorting_option(4, [this](const int i) { return addon_vector_[i]->display_type(); }); - auto order = std::make_pair(0, preferences::SORT_ORDER::ASCENDING); + auto order = std::pair(0, preferences::SORT_ORDER::ASCENDING); list.set_active_sorting_option(order); } diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 3ebe2ee236d..3a37a345d10 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -666,11 +666,11 @@ const listbox::order_pair listbox::get_active_sorting_option() selectable_item* w = orders_[column].first; if(w && w->get_value() != SORT_ORDER::NONE) { - return std::make_pair(column, static_cast(w->get_value())); + return std::pair(column, static_cast(w->get_value())); } } - return std::make_pair(-1, SORT_ORDER::NONE); + return std::pair(-1, SORT_ORDER::NONE); } void listbox::mark_as_unsorted() diff --git a/src/gui/widgets/tree_view.cpp b/src/gui/widgets/tree_view.cpp index fac040e7506..f26ca36fbcb 100644 --- a/src/gui/widgets/tree_view.cpp +++ b/src/gui/widgets/tree_view.cpp @@ -82,7 +82,7 @@ std::pair tree_view::remove_node(tree_view_node* nod resize_content(0, -node_size.y); } - return std::make_pair(std::move(old_node), position); + return std::pair(std::move(old_node), position); } void tree_view::clear() diff --git a/src/map/map.cpp b/src/map/map.cpp index 92b9213e064..810d44e5a95 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -370,7 +370,7 @@ void gamemap::set_special_location(const std::string& id, const map_location& lo } } else { - starting_positions_.left.insert(it_left, std::make_pair(id, loc)); + starting_positions_.left.insert(it_left, std::pair(id, loc)); } } diff --git a/src/pathfind/pathfind.cpp b/src/pathfind/pathfind.cpp index de72813fd8b..1c71e404f2a 100644 --- a/src/pathfind/pathfind.cpp +++ b/src/pathfind/pathfind.cpp @@ -882,7 +882,7 @@ full_cost_map::full_cost_map(const unit& u, bool force_ignore_zoc, viewing_team_(viewing_team), see_all_(see_all), ignore_units_(ignore_units) { const gamemap& map = resources::gameboard->map(); - cost_map = std::vector>(map.w() * map.h(), std::make_pair(-1, 0)); + cost_map = std::vector>(map.w() * map.h(), std::pair(-1, 0)); add_unit(u); } @@ -897,7 +897,7 @@ full_cost_map::full_cost_map(bool force_ignore_zoc, viewing_team_(viewing_team), see_all_(see_all), ignore_units_(ignore_units) { const gamemap& map = resources::gameboard->map(); - cost_map = std::vector>(map.w() * map.h(), std::make_pair(-1, 0)); + cost_map = std::vector>(map.w() * map.h(), std::pair(-1, 0)); } /** @@ -962,7 +962,7 @@ std::pair full_cost_map::get_pair_at(map_location loc) const assert(cost_map.size() == static_cast(map.w() * map.h())); if (!map.on_board(loc)) { - return std::make_pair(-1, 0); // invalid + return std::pair(-1, 0); // invalid } return cost_map[loc.x + (loc.y * map.w())]; diff --git a/src/preferences/game.cpp b/src/preferences/game.cpp index c9413089eb4..0ce6aa47b03 100644 --- a/src/preferences/game.cpp +++ b/src/preferences/game.cpp @@ -231,7 +231,7 @@ std::pair add_acquaintance( const std::string& nick, const std::string& mode, const std::string& notes) { if(!utils::isvalid_wildcard(nick)) { - return std::make_pair(nullptr, false); + return std::pair(nullptr, false); } preferences::acquaintance new_entry(nick, mode, notes); @@ -243,7 +243,7 @@ std::pair add_acquaintance( save_acquaintances(); - return std::make_pair(&iter->second, success); + return std::pair(&iter->second, success); } bool remove_acquaintance(const std::string& nick) diff --git a/src/scripting/lua_terrainmap.cpp b/src/scripting/lua_terrainmap.cpp index d1dd32639ab..340d78e2147 100644 --- a/src/scripting/lua_terrainmap.cpp +++ b/src/scripting/lua_terrainmap.cpp @@ -174,7 +174,7 @@ void mapgen_gamemap::set_special_location(const std::string& id, const map_locat } } else { - starting_positions_.left.insert(it_left, std::make_pair(id, loc)); + starting_positions_.left.insert(it_left, std::pair(id, loc)); } } diff --git a/src/serialization/string_utils.cpp b/src/serialization/string_utils.cpp index 7e0622d088b..4bc1fd13d2a 100644 --- a/src/serialization/string_utils.cpp +++ b/src/serialization/string_utils.cpp @@ -815,9 +815,9 @@ std::pair parse_range(const std::string& str) std::pair res {0,0}; try { if (b == "infinity") { - res = std::make_pair(std::stoi(a), std::numeric_limits::max()); + res = std::pair(std::stoi(a), std::numeric_limits::max()); } else { - res = std::make_pair(std::stoi(a), std::stoi(b)); + res = std::pair(std::stoi(a), std::stoi(b)); } if (res.second < res.first) { diff --git a/src/serialization/ucs4_iterator_base.hpp b/src/serialization/ucs4_iterator_base.hpp index 03f0587aee2..f396b765a45 100644 --- a/src/serialization/ucs4_iterator_base.hpp +++ b/src/serialization/ucs4_iterator_base.hpp @@ -33,7 +33,7 @@ namespace ucs4 iterator_base(const string_type& str) : current_char(0) , string_end(str.end()) - , current_substr(std::make_pair(str.begin(), str.begin())) + , current_substr(std::pair(str.begin(), str.begin())) { update(); } @@ -41,7 +41,7 @@ namespace ucs4 iterator_base(typename string_type::const_iterator const& begin, typename string_type::const_iterator const& end) : current_char(0) , string_end(end) - , current_substr(std::make_pair(begin, begin)) + , current_substr(std::pair(begin, begin)) { update(); } diff --git a/src/statistics.cpp b/src/statistics.cpp index 9a400c721d3..427cc057827 100644 --- a/src/statistics.cpp +++ b/src/statistics.cpp @@ -130,7 +130,7 @@ static void write_str_int_map(config_writer &out, const stats::str_int_map& m) m.begin(), m.end(), std::inserter(rev, rev.begin()), [](const stats::str_int_map::value_type p) { - return std::make_pair(p.second, p.first); + return std::pair(p.second, p.first); } ); reverse_map::const_iterator i = rev.begin(), j; diff --git a/src/synced_user_choice.cpp b/src/synced_user_choice.cpp index ecf71f6a258..2336050dbfa 100644 --- a/src/synced_user_choice.cpp +++ b/src/synced_user_choice.cpp @@ -330,7 +330,7 @@ void user_choice_manager::update_local_choice() "waiting for $desc from side $sides", "waiting for $desc from sides $sides", sides_str.size(), - {std::make_pair("desc", uch_.description()), std::make_pair("sides", utils::format_conjunct_list("", sides_str))} + {std::pair("desc", uch_.description()), std::pair("sides", utils::format_conjunct_list("", sides_str))} ); if(local_choice_prev != local_choice_) { changed_event_.notify_observers(); diff --git a/src/tracer.hpp b/src/tracer.hpp index 8f98ebe92e3..3a9e147129c 100644 --- a/src/tracer.hpp +++ b/src/tracer.hpp @@ -99,5 +99,5 @@ struct tracer */ #define TRACER_COUNT(marker) \ do { \ - ++tracer.counters[std::make_pair(__LINE__, marker)]; \ + ++tracer.counters[std::pair(__LINE__, marker)]; \ } while(false) diff --git a/src/units/abilities.cpp b/src/units/abilities.cpp index a18fd8e5d87..b1901718790 100644 --- a/src/units/abilities.cpp +++ b/src/units/abilities.cpp @@ -550,7 +550,7 @@ template std::pair unit_ability_list::get_extremum(const std::string& key, int def, const TComp& comp) const { if ( cfgs_.empty() ) { - return std::make_pair(def, map_location()); + return std::pair(def, map_location()); } // The returned location is the best non-cumulative one, if any, // the best absolute cumulative one otherwise. @@ -578,7 +578,7 @@ std::pair unit_ability_list::get_extremum(const std::string& k best_loc = p.teacher_loc; } } - return std::make_pair(flat + stack, best_loc); + return std::pair(flat + stack, best_loc); } template std::pair unit_ability_list::get_extremum>(const std::string& key, int def, const std::less& comp) const; diff --git a/src/units/map.cpp b/src/units/map.cpp index a5813e0c7e8..3ca68d7e7cf 100644 --- a/src/units/map.cpp +++ b/src/units/map.cpp @@ -97,19 +97,19 @@ unit_map::umap_retval_pair_t unit_map::move(const map_location& src, const map_l // Find the unit at the src location lmap::iterator i = lmap_.find(src); if(i == lmap_.end()) { - return std::make_pair(make_unit_iterator(i), false); + return std::pair(make_unit_iterator(i), false); } umap::iterator uit(i->second); if(src == dst) { - return std::make_pair(make_unit_iterator(uit), true); + return std::pair(make_unit_iterator(uit), true); } // Fail if there is no unit to move. unit_ptr p = uit->second.unit; if(!p) { - return std::make_pair(make_unit_iterator(uit), false); + return std::pair(make_unit_iterator(uit), false); } p->set_location(dst); @@ -122,12 +122,12 @@ unit_map::umap_retval_pair_t unit_map::move(const map_location& src, const map_l if(res.second == false) { p->set_location(src); lmap_.emplace(src, uit); - return std::make_pair(make_unit_iterator(uit), false); + return std::pair(make_unit_iterator(uit), false); } self_check(); - return std::make_pair(make_unit_iterator(uit), true); + return std::pair(make_unit_iterator(uit), true); } unit_map::umap_retval_pair_t unit_map::insert(unit_ptr p) @@ -144,7 +144,7 @@ unit_map::umap_retval_pair_t unit_map::insert(unit_ptr p) if(!loc.valid()) { ERR_NG << "Trying to add " << p->name() << " - " << p->id() << " at an invalid location; Discarding.\n"; - return std::make_pair(make_unit_iterator(umap_.end()), false); + return std::pair(make_unit_iterator(umap_.end()), false); } unit_pod upod; @@ -213,11 +213,11 @@ unit_map::umap_retval_pair_t unit_map::insert(unit_ptr p) << (linsert.first->second->second).unit->name() << " - " << linsert.first->second->second.unit->id() << "\n"; - return std::make_pair(make_unit_iterator(umap_.end()), false); + return std::pair(make_unit_iterator(umap_.end()), false); } self_check(); - return std::make_pair(make_unit_iterator(uinsert.first), true); + return std::pair(make_unit_iterator(uinsert.first), true); } unit_map::umap_retval_pair_t unit_map::replace(const map_location& l, unit_ptr p) diff --git a/src/whiteboard/utility.cpp b/src/whiteboard/utility.cpp index 31fa9ec82e6..b2301113a69 100644 --- a/src/whiteboard/utility.cpp +++ b/src/whiteboard/utility.cpp @@ -139,7 +139,7 @@ int path_cost(const std::vector& path, const unit& u) int result = 0; const gamemap& map = resources::gameboard->map(); - for(const map_location& loc : std::make_pair(path.begin()+1,path.end())) { + for(const map_location& loc : std::pair(path.begin()+1,path.end())) { result += u.movement_cost(map[loc]); } return result; diff --git a/src/widgets/menu.cpp b/src/widgets/menu.cpp index 8c9fe8b4bb8..12d690fd31b 100644 --- a/src/widgets/menu.cpp +++ b/src/widgets/menu.cpp @@ -109,7 +109,7 @@ static std::pair parse_fraction(const std::string& s) parts.resize(2); int num = lexical_cast_default(parts[0], 0); int denom = lexical_cast_default(parts[1], 0); - return std::make_pair(num, denom); + return std::pair(num, denom); } static int xp_to_advance(const std::string& s) {