userver icon indicating copy to clipboard operation
userver copied to clipboard

Implement reverse iterators for the arrays in formats::yaml::Value

Open apolukhin opened this issue 3 years ago • 2 comments

The reverse iterators for arrays in formats::yaml::Value would be handy https://github.com/userver-framework/userver/blob/develop/shared/include/userver/formats/yaml/value.hpp

Note that key in YAML are unordered, so there's no sence in making reverse iterators for keys.

For an example see reverse iterators in formats::json::Value https://github.com/userver-framework/userver/blob/develop/shared/include/userver/formats/json/value.hpp

apolukhin avatar Oct 31 '22 09:10 apolukhin

@apolukhin, I've took a look at the issue and it turns out that userver/formats/yaml/ iterators are simply wrappers for iterators from the yaml-cpp library and the yaml-cpp iterators don't support reverse semantic now.
Probably, a good solution would be to implement reverse iterators in the yaml-cpp at first. Am I right or you supposed a different approach here?

oleggladyshev avatar Dec 20 '22 10:12 oleggladyshev

You are right. It seems that the fix should be done in yaml-cpp first

apolukhin avatar Apr 26 '24 12:04 apolukhin