From 328445c947e9efa5c73ce7f882324d86c346f307 Mon Sep 17 00:00:00 2001 From: lazysegtree <59679977+lazysegtree@users.noreply.github.com> Date: Mon, 12 Jan 2026 20:21:33 +0530 Subject: [PATCH] fix: Use stable_partition for deterministic ordering --- include/cxxopts.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index a5c67f1..1795169 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -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);