From e1496a87178d925277aceed0ebcbab06920e15ee Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Mon, 25 Dec 2023 02:42:11 -0500 Subject: Add `https://github.com/Tessil/ordered-map` Add is_specialization_of to Utility.hpp Add OpenVic::ordered_map and OpenVic::ordered_set Change `std::map` to `ordered_map` Change `std::set to use `ordered_set` Add `set_callback_pointer(tsl::ordered_set& set)` Add mutable_iterator to enable mutable value iterator for `tsl::ordered_map` Add std::hash implementation Enable deps/SCsub to expose dependency includes neccessary for inclusion --- src/openvic-simulation/economy/ProductionType.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/openvic-simulation/economy') diff --git a/src/openvic-simulation/economy/ProductionType.cpp b/src/openvic-simulation/economy/ProductionType.cpp index 05529f5..f0ad6ea 100644 --- a/src/openvic-simulation/economy/ProductionType.cpp +++ b/src/openvic-simulation/economy/ProductionType.cpp @@ -1,5 +1,7 @@ #include "ProductionType.hpp" +#include "openvic-simulation/types/OrderedContainers.hpp" + using namespace OpenVic; using namespace OpenVic::NodeTools; @@ -130,8 +132,8 @@ bool ProductionTypeManager::load_production_types_file( size_t expected_types = 0; // pass 1: find and store template identifiers - std::set templates; - std::map template_target_map; + ordered_set templates; + ordered_map template_target_map; bool ret = expect_dictionary( [this, &expected_types, &templates, &template_target_map](std::string_view key, ast::NodeCPtr value) -> bool { expected_types++; @@ -154,7 +156,7 @@ bool ProductionTypeManager::load_production_types_file( )(root); // pass 2: create and populate the template map - std::map template_node_map; + ordered_map template_node_map; ret &= expect_dictionary( [this, &expected_types, &templates, &template_node_map](std::string_view key, ast::NodeCPtr value) -> bool { if (templates.contains(key)) { -- cgit v1.2.3-56-ga3b1