mirror of https://github.com/jarro2783/cxxopts.git
fix: Use stable_partition for deterministic ordering
This commit is contained in:
parent
c9dfa286a2
commit
328445c947
|
|
@ -2339,7 +2339,7 @@ OptionAdder::operator()
|
|||
// (length-1) and longer names
|
||||
std::string short_name {""};
|
||||
auto first_short_name_iter =
|
||||
std::partition(option_names.begin(), option_names.end(),
|
||||
std::stable_partition(option_names.begin(), option_names.end(),
|
||||
[&](const std::string& name) { return name.length() > 1; }
|
||||
);
|
||||
auto num_length_1_names = (option_names.end() - first_short_name_iter);
|
||||
|
|
|
|||
Loading…
Reference in New Issue