Date: Sat, 28 Nov 2026 20:32:08 +0000
On Sat, 28 Nov 2026 at 20:29, Aleksandr Povaliaev <apovalyaev_at_[hidden]>
wrote:
> Just use SubKey1 alone when it is necessary, and tuple<SubKey1,SubKey2>
> when both SubKey's are necessary for exact value search. It doesn't make
> sense to use tuple<SubKey1,SubKey2,SubKey3> as an unordered_set Key, when
> you only need one of them - again, it is a waste of cache memory and a
> possible source of errors.
>
Please stop telling people how they should write their code. It's possible
some of us know what we're doing and just have use cases you don't
understand (and refuse to listen to).
>
> сб, 28 нояб. 2026 г. в 23:20, Jonathan Wakely via Std-Proposals <
> std-proposals_at_[hidden]>:
>
>>
>>
>> On Sat, 28 Nov 2026 at 19:34, Andrey Semashev via Std-Proposals <
>> std-proposals_at_[hidden]> wrote:
>>
>>> On 28 Nov 2026 21:14, Aleksandr Povaliaev via Std-Proposals wrote:
>>> > I don't like the idea of having two different comparison operators for
>>> > the same Key class.
>>> > This is erroneous flexibility - I can't imagine a design pattern which
>>> > somehow can explain "having two different comparison operators" - it
>>> > only adds a mess.
>>>
>>> No, having multiple comparison predicates can be very much sensible, as
>>> there can be multiple ways in which two objects are considered
>>> equivalent. For example, your unordered_set may use a subset of data
>>> comprising the element for hashing and equivalence predicate, and you
>>> may also have an operator== that compares the entire objects.
>>>
>>
>> I already tried to explain this with the tuple<A,B,C> example, where only
>> the A element is used as the container key. The response was ... unclear.
>> --
>> Std-Proposals mailing list
>> Std-Proposals_at_[hidden]
>> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>>
>
wrote:
> Just use SubKey1 alone when it is necessary, and tuple<SubKey1,SubKey2>
> when both SubKey's are necessary for exact value search. It doesn't make
> sense to use tuple<SubKey1,SubKey2,SubKey3> as an unordered_set Key, when
> you only need one of them - again, it is a waste of cache memory and a
> possible source of errors.
>
Please stop telling people how they should write their code. It's possible
some of us know what we're doing and just have use cases you don't
understand (and refuse to listen to).
>
> сб, 28 нояб. 2026 г. в 23:20, Jonathan Wakely via Std-Proposals <
> std-proposals_at_[hidden]>:
>
>>
>>
>> On Sat, 28 Nov 2026 at 19:34, Andrey Semashev via Std-Proposals <
>> std-proposals_at_[hidden]> wrote:
>>
>>> On 28 Nov 2026 21:14, Aleksandr Povaliaev via Std-Proposals wrote:
>>> > I don't like the idea of having two different comparison operators for
>>> > the same Key class.
>>> > This is erroneous flexibility - I can't imagine a design pattern which
>>> > somehow can explain "having two different comparison operators" - it
>>> > only adds a mess.
>>>
>>> No, having multiple comparison predicates can be very much sensible, as
>>> there can be multiple ways in which two objects are considered
>>> equivalent. For example, your unordered_set may use a subset of data
>>> comprising the element for hashing and equivalence predicate, and you
>>> may also have an operator== that compares the entire objects.
>>>
>>
>> I already tried to explain this with the tuple<A,B,C> example, where only
>> the A element is used as the container key. The response was ... unclear.
>> --
>> Std-Proposals mailing list
>> Std-Proposals_at_[hidden]
>> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>>
>
Received on 2026-11-28 20:32:26
