C++ Logo

sg14

Advanced search

Re: [SG14] [isocpp-lib-ext] std::colony name brainstorming

From: Tony V E <tvaneerd_at_[hidden]>
Date: Wed, 10 Feb 2021 13:36:36 -0500
On Wed, Feb 10, 2021 at 10:33 AM Ville Voutilainen via Lib-Ext <
lib-ext_at_[hidden]> wrote:

>
> That does seem like an alternative that describes the structure more
> than it does describe the purpose. But, then again,
> that's somewhat consistent with what we've had before. But also
> somewhat inconsistent, an unordered_map is not
> a hash_keyed_list_of_buckets.
>
>
unordered_map is only called "unordered" because the first one should have
been called ordered_map, but wasn't. "ordered_map" would be good for two
reasons - it tells you that ordering is an important feature of the
structure, and it also tells you - or at least hints - that the items need
to be orderable to be used in the map. Otherwise I might expect a
map<Key,Value> to be able to use any Key, maybe only requiring operator!=()
to check for Key uniqueness.

hash_map is actually a correct name because hashing is part of the essence
of the data structure - it is *not* an implementation detail - you need
your Key to be hashable or it doesn't work.

..._list_of_buckets would be bad because that would be implementation
leaking out. (And some of unordered_map's spec that over-specifies the
buckets is also implementation leaking out)


-- 
Be seeing you,
Tony

Received on 2021-02-10 12:36:53