Add three way lower_bound
François Dumont
frs.dumont@gmail.com
Wed Jun 23 20:34:13 GMT 2021
Hi
Following the message to propose an alternative lower_bound and the
reply to use three way comparison I try to implement this.
Before going further I wonder if this is something possible ?
The purpose of the:
if constexpr (three_way_comparable<>)
is to make sure that we use it only if there is a proper <=> operator
defined. Afai understood what is in <compare> we can have the
__synth3way for any type as long as < exist. But I think that if <=> is
implemented in terms of < then it might be too expensive, the actual
lower_bound might already be implemented this way.
My main concerns is of course Standard conformity, could it be ok ?
François
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lower_bound_three_way.patch
Type: text/x-patch
Size: 2081 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20210623/d61397ea/attachment.bin>
More information about the Libstdc++
mailing list