Rafael Sadowski writes:

> On Fri Aug 21, 2026 at 02:15:34PM +0200, Theo Buehler wrote:
>> There are basically two main classes of failures: comparison operators
>> and locale things and a few odd ones like fish/v3 and 
>> 
>> audio/ncmpcpp
>> /usr/include/c++/v1/__algorithm/sift_down.h:49:39: error: no matching 
>> function for call to object of type 'LocaleBasedSorting'
>>    49 |   } else if ((__child + 1) < __len && __comp(__first[__child], 
>> __first[__child + 1])) {
>>       |                                       ^~~~~~
>> 
>
> The lambdas are more or less a workaround from me.
>
> I think, the much cleaner fix would be to teach LocaleBasedSorting to
> handle all this, but that means digging even depper into the Boost
> lib. I don't want go this way. Anyone?

I will take a look at this tomorrow with some fresh eyes. I posted about
my investigation here with a crude hack to sift_down.h to revert it to
be more like 19.1.7. The original poster used stable_sort. I was curious
why [] didn't work but it was happy with pointer arithmetic. Is it
boost::iterators::transform_iterator or LocaleBasedSorting that can't
deal with []? I see your comment notes that template argument deduction
broke.

https://github.com/ncmpcpp/ncmpcpp/issues/663#issuecomment-5436536200


>
> diff --git
> a/audio/ncmpcpp/patches/patch-src_screens_sel_items_adder_cpp
> b/audio/ncmpcpp/patches/patch-src_screens_sel_items_adder_cpp
> new file mode 100644
> index 00000000000..8f4ca627847
> --- /dev/null
> +++ b/audio/ncmpcpp/patches/patch-src_screens_sel_items_adder_cpp
> @@ -0,0 +1,16 @@
> +Fix build with libc++22: Boost operator[] proxy breaks template argument
> +deduction in LocaleBasedSorting.
> +Index: src/screens/sel_items_adder.cpp
> +--- src/screens/sel_items_adder.cpp.orig
> ++++ src/screens/sel_items_adder.cpp
> +@@ -254,7 +254,9 @@ void SelectedItemsAdder::populatePlaylistSelector(Base
> +                     ));
> +             };
> +             std::sort(m_playlist_selector.beginV()+begin, 
> m_playlist_selector.endV(),
> +-                    LocaleBasedSorting(std::locale(), 
> Config.ignore_leading_the));
> ++                    [cmp = LocaleBasedSorting(std::locale(), 
> Config.ignore_leading_the)]
> ++                    (const Entry &a, const Entry &b) { return cmp(a, b); });
> ++
> +             if (begin < m_playlist_selector.size())
> +                     m_playlist_selector.addSeparator();
> +     }
> diff --git a/audio/ncmpcpp/patches/patch-src_screens_tag_editor_cpp
> b/audio/ncmpcpp/patches/patch-src_screens_tag_editor_cpp
> new file mode 100644
> index 00000000000..24a6fa9d851
> --- /dev/null
> +++ b/audio/ncmpcpp/patches/patch-src_screens_tag_editor_cpp
> @@ -0,0 +1,16 @@
> +Fix build with libc++22: Boost operator[] proxy breaks template argument
> +deduction in LocaleBasedSorting.
> +Index: src/screens/tag_editor.cpp
> +--- src/screens/tag_editor.cpp.orig
> ++++ src/screens/tag_editor.cpp
> +@@ -289,7 +289,9 @@ void TagEditor::update()
> +                             Dirs->highlight(Dirs->size()-1);
> +             };
> +             std::sort(Dirs->beginV()+1, Dirs->endV(),
> +-                    LocaleBasedSorting(std::locale(), 
> Config.ignore_leading_the));
> ++                    [cmp = LocaleBasedSorting(std::locale(), 
> Config.ignore_leading_the)]
> ++                    (const std::pair<std::string, std::string> &a,
> ++                     const std::pair<std::string, std::string> &b) { return 
> cmp(a, b); });
> +             Dirs->display();
> +     }
> +     

Reply via email to