@@ -677,8 +677,12 @@ bool CountryInstance::remove_unit_instance_group(UnitInstanceGroup const& group)
677677 const auto remove_from_vector = [this , &group]<unit_branch_t Branch>(
678678 memory::vector<UnitInstanceGroupBranched<Branch>*>& unit_instance_groups
679679 ) -> bool {
680- const typename memory::vector<UnitInstanceGroupBranched<Branch>*>::const_iterator it =
681- std::find (unit_instance_groups.begin (), unit_instance_groups.end (), &group);
680+ using const_it_t = typename memory::vector<UnitInstanceGroupBranched<Branch>*>::const_iterator;
681+ const const_it_t it = std::find (
682+ unit_instance_groups.begin (),
683+ unit_instance_groups.end (),
684+ &group
685+ );
682686
683687 if (it != unit_instance_groups.end ()) {
684688 unit_instance_groups.erase (it);
@@ -1227,12 +1231,14 @@ bool CountryInstance::apply_history_to_country(
12271231 ret &= add_reform (*reform);
12281232 }
12291233 set_optional_state (tech_school, entry.get_tech_school ());
1230- constexpr auto set_bool_map_to_indexed_map =
1231- []<typename T>(IndexedFlatMap<T, bool >& target, ordered_map<T const *, bool > source) {
1232- for (auto const & [key, value] : source) {
1233- target[*key] = value;
1234- }
1235- };
1234+ constexpr auto set_bool_map_to_indexed_map = []<typename T>(
1235+ IndexedFlatMap<T, bool >& target,
1236+ ordered_map<T const *, bool > source
1237+ ) {
1238+ for (auto const & [key, value] : source) {
1239+ target[*key] = value;
1240+ }
1241+ };
12361242
12371243 for (auto const & [technology, level] : entry.get_technologies ()) {
12381244 ret &= set_technology_unlock_level (*technology, level);
@@ -1467,9 +1473,9 @@ void CountryInstance::_update_technology(const Date today) {
14671473 }
14681474
14691475 daily_research_points += get_modifier_effect_value (*modifier_effect_cache.get_research_points ());
1470- daily_research_points *= fixed_point_t ::_1 +
1471- get_modifier_effect_value (*modifier_effect_cache.get_research_points_modifier ()) +
1472- get_modifier_effect_value (*modifier_effect_cache.get_increase_research ());
1476+ daily_research_points *= fixed_point_t ::_1
1477+ + get_modifier_effect_value (*modifier_effect_cache.get_research_points_modifier ())
1478+ + get_modifier_effect_value (*modifier_effect_cache.get_increase_research ());
14731479
14741480 if (daily_research_points.get_untracked () < 0 ) {
14751481 daily_research_points.set (0 );
@@ -1601,8 +1607,8 @@ void CountryInstance::_update_military() {
16011607
16021608 // Mobilisation calculations
16031609 mobilisation_impact = get_modifier_effect_value (*modifier_effect_cache.get_mobilization_impact ());
1604- mobilisation_economy_impact = get_modifier_effect_value (*modifier_effect_cache.get_mobilisation_economy_impact_tech ()) +
1605- get_modifier_effect_value (*modifier_effect_cache.get_mobilisation_economy_impact_country ());
1610+ mobilisation_economy_impact = get_modifier_effect_value (*modifier_effect_cache.get_mobilisation_economy_impact_tech ())
1611+ + get_modifier_effect_value (*modifier_effect_cache.get_mobilisation_economy_impact_country ());
16061612
16071613 // TODO - use country_defines.get_min_mobilize_limit(); (wiki: "lowest maximum of brigades you can mobilize. (by default 3)")
16081614
@@ -1621,9 +1627,9 @@ void CountryInstance::_update_military() {
16211627 get_modifier_effect_value (*modifier_effect_cache.get_max_war_exhaustion ()), fixed_point_t ::_0
16221628 );
16231629
1624- organisation_regain = fixed_point_t ::_1 +
1625- get_modifier_effect_value (*modifier_effect_cache.get_org_regain ()) +
1626- get_modifier_effect_value (*modifier_effect_cache.get_morale_global ());
1630+ organisation_regain = fixed_point_t ::_1
1631+ + get_modifier_effect_value (*modifier_effect_cache.get_org_regain ())
1632+ + get_modifier_effect_value (*modifier_effect_cache.get_morale_global ());
16271633
16281634 land_organisation = fixed_point_t ::_1 + get_modifier_effect_value (*modifier_effect_cache.get_land_organisation ());
16291635 naval_organisation = fixed_point_t ::_1 + get_modifier_effect_value (*modifier_effect_cache.get_naval_organisation ());
@@ -1641,17 +1647,17 @@ void CountryInstance::_update_military() {
16411647 ).floor <type_safe::underlying_type<combat_width_t >>()
16421648 );
16431649 dig_in_cap = get_modifier_effect_value (*modifier_effect_cache.get_dig_in_cap ()).floor <int32_t >();
1644- military_tactics = military_defines.get_base_military_tactics () +
1645- get_modifier_effect_value (*modifier_effect_cache.get_military_tactics ());
1650+ military_tactics = military_defines.get_base_military_tactics ()
1651+ + get_modifier_effect_value (*modifier_effect_cache.get_military_tactics ());
16461652
16471653 if (leadership_point_stockpile < 0 ) {
16481654 leadership_point_stockpile = 0 ;
16491655 }
16501656 create_leader_count = (leadership_point_stockpile / military_defines.get_leader_recruit_cost ()).floor <int32_t >();
16511657
16521658 monthly_leadership_points += get_modifier_effect_value (*modifier_effect_cache.get_leadership ());
1653- monthly_leadership_points *= fixed_point_t ::_1 +
1654- get_modifier_effect_value (*modifier_effect_cache.get_leadership_modifier ());
1659+ monthly_leadership_points *= fixed_point_t ::_1
1660+ + get_modifier_effect_value (*modifier_effect_cache.get_leadership_modifier ());
16551661
16561662 if (monthly_leadership_points < 0 ) {
16571663 monthly_leadership_points = 0 ;
@@ -1888,8 +1894,8 @@ void CountryInstance::update_gamestate(const Date today, MapInstance& map_instan
18881894 _update_politics ();
18891895 _update_diplomacy ();
18901896
1891- const CountryDefinition::government_colour_map_t ::const_iterator it =
1892- country_definition.get_alternative_colours ().find (government_type.get_untracked ());
1897+ using const_it_t = typename CountryDefinition::government_colour_map_t ::const_iterator;
1898+ const const_it_t it = country_definition.get_alternative_colours ().find (government_type.get_untracked ());
18931899
18941900 if (it != country_definition.get_alternative_colours ().end ()) {
18951901 colour = it.value ();
0 commit comments