From c56131a7d615e20e117114e005d0a3e4c9fae2ca Mon Sep 17 00:00:00 2001 From: hop311 Date: Tue, 23 Jan 2024 23:12:36 +0000 Subject: Made Date constexpr so that PROPERTY getters can be constexpr --- src/openvic-simulation/types/IdentifierRegistry.hpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/openvic-simulation/types/IdentifierRegistry.hpp') diff --git a/src/openvic-simulation/types/IdentifierRegistry.hpp b/src/openvic-simulation/types/IdentifierRegistry.hpp index 10248cc..1774bb0 100644 --- a/src/openvic-simulation/types/IdentifierRegistry.hpp +++ b/src/openvic-simulation/types/IdentifierRegistry.hpp @@ -158,19 +158,15 @@ namespace OpenVic { static constexpr bool storage_type_reservable = Reservable; private: - const std::string name; + const std::string PROPERTY(name); const bool log_lock; storage_type PROPERTY_REF(items); - bool locked = false; + bool PROPERTY_CUSTOM_PREFIX(locked, is); identifier_index_map_t identifier_index_map; public: constexpr UniqueKeyRegistry(std::string_view new_name, bool new_log_lock = true) - : name { new_name }, log_lock { new_log_lock } {} - - constexpr std::string_view get_name() const { - return name; - } + : name { new_name }, log_lock { new_log_lock }, locked { false } {} constexpr bool add_item( item_type&& item, NodeTools::Callback auto duplicate_callback @@ -206,10 +202,6 @@ namespace OpenVic { } } - constexpr bool is_locked() const { - return locked; - } - constexpr void reset() { identifier_index_map.clear(); items.clear(); -- cgit v1.2.3-56-ga3b1