From 67cbd14630c4344902d3fa1ddca178809da4293b Mon Sep 17 00:00:00 2001 From: hop311 Date: Sun, 21 Jul 2024 14:09:25 +0100 Subject: Fleshing out Country, State and Province instances + history --- src/openvic-simulation/types/IndexedMap.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/openvic-simulation/types/IndexedMap.hpp') diff --git a/src/openvic-simulation/types/IndexedMap.hpp b/src/openvic-simulation/types/IndexedMap.hpp index 68effb9..30cf5cd 100644 --- a/src/openvic-simulation/types/IndexedMap.hpp +++ b/src/openvic-simulation/types/IndexedMap.hpp @@ -14,6 +14,8 @@ namespace OpenVic { using container_t = std::vector; using key_t = Key; using value_t = Value; + using value_ref_t = container_t::reference; + using value_const_ref_t = container_t::const_reference; using keys_t = std::vector; using container_t::operator[]; @@ -91,11 +93,11 @@ namespace OpenVic { } } - constexpr value_t& operator[](key_t const& key) { + constexpr value_ref_t operator[](key_t const& key) { return container_t::operator[](get_index_from_item(key)); } - constexpr value_t const& operator[](key_t const& key) const { + constexpr value_const_ref_t operator[](key_t const& key) const { return container_t::operator[](get_index_from_item(key)); } -- cgit v1.2.3-56-ga3b1