Skip to content

Commit 1999fe2

Browse files
authored
Update Metadata.h
1 parent 65e2b82 commit 1999fe2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/multio/message/Metadata.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@ class Metadata : public BaseMetadata {
5151
using Iterator = typename MapType::iterator;
5252
using ConstIterator = typename MapType::const_iterator;
5353

54-
// Onlything we need to change to support lookups in parametrization
54+
// The single place we need to change to support lookups in parametrization.
55+
// Important: The non-const version will copy values from the global parametrization dictionary
56+
// to the local one - It will always return an iterator to the local dictionary.
57+
// This allows values to be modified in the local object directly.
58+
//
59+
// The const version will return either an iterator to the local object or the
60+
// global parametrization dictionary.
61+
// If keys are assumed to hold nested objects or large arrays which won't be modified anyway -
62+
// it is reasonable to explicitly const-cast the object to select the const lookup version.
5563
Iterator find(const KeyType& k) override;
5664
ConstIterator find(const KeyType& k) const override;
5765

0 commit comments

Comments
 (0)