#74 Fixed keeping insertion orders of mapping node items #76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The order of inserting mapping node items has been fixed to keep the insertion order, not weak comparison order like std::map objects have.
This is because, as for YAML formatted files, the order of keys in the file seems to be somehow important for the readers to understand logical relations between YAML nodes.
Such a fix has been realized by implementing
OrderedMap
class which behaves as a map-like container but still preserves the insertion order of keys.The
OrderedMap
class currently has its minimal implementation only to the extent to which it can be compiled successfully.The further implementation will be added when some additional features are necessary to achieve more complex behaviors.