diff options
author | Hop311 <Hop3114@gmail.com> | 2024-07-19 21:35:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-19 21:35:31 +0200 |
commit | d1f3a96b72dd06b5f97dd4643e5f016a02b42ea6 (patch) | |
tree | 38015e5729afbb98cf520e2cf26d8a4623d32f2f /src/openvic-simulation/types/HasIdentifier.hpp | |
parent | e0518bee9b4c164f40716a8033b5e207c2060c0b (diff) | |
parent | 03647d2249f72b6545628bb844685f87c4581062 (diff) |
Merge pull request #176 from OpenVicProject/format-cleanup
Cleanup: inheritance, const movable variables, code formatting
Diffstat (limited to 'src/openvic-simulation/types/HasIdentifier.hpp')
-rw-r--r-- | src/openvic-simulation/types/HasIdentifier.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/openvic-simulation/types/HasIdentifier.hpp b/src/openvic-simulation/types/HasIdentifier.hpp index 941eae9..925d58b 100644 --- a/src/openvic-simulation/types/HasIdentifier.hpp +++ b/src/openvic-simulation/types/HasIdentifier.hpp @@ -27,7 +27,8 @@ namespace OpenVic { * can be entered into an IdentifierRegistry instance. */ class HasIdentifier { - const std::string PROPERTY(identifier); + /* Not const so it can be moved rather than needing to be copied. */ + std::string PROPERTY(identifier); protected: HasIdentifier(std::string_view new_identifier): identifier { new_identifier } { @@ -67,6 +68,9 @@ namespace OpenVic { _HasColour& operator=(_HasColour&&) = delete; }; + using HasColour = _HasColour<colour_t>; + using HasAlphaColour = _HasColour<colour_argb_t>; + /* * Base class for objects with a unique string identifier and associated colour information. */ |