RFC: PR libstdc++/80064 make heap algorithms work with function types
Jonathan Wakely
jwakely@redhat.com
Thu Mar 16 13:44:00 GMT 2017
On 16/03/17 15:31 +0200, Ville Voutilainen wrote:
>All in all it seems to some extent reasonable to me to allow such
>code. It seems rather easy
>to fail to provide a function pointer as the comparator type, but also
>rather easy for the implementation
>to not mind that. I do find it suspicious that any user code would
>bother providing the comparator
>type as a template argument, though; whenever users feel encouraged to
>do that, trouble ensues.
>At this point I'm gravitating towards fixing the regression now, and
>possibly being more stringent in the next
>release, meaning gcc 8.
Yeah, we could add a static_assert with a user-friendly message
telling them why the code is invalid, instead of an impenetrable error
about internal implementation details.
So I'll commit the fix, treating it as a regression.
More information about the Libstdc++
mailing list