From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Trait based containers
Date: Mon, 7 May 2018 09:14:22 +0200
Date: 2018-05-07T09:14:22+02:00 [thread overview]
Message-ID: <pcoucb$1bvj$1@gioia.aioe.org> (raw)
In-Reply-To: fa962e1b-eaa1-416f-886f-0dcb0d4e359f@googlegroups.com
On 07/05/2018 09:02, briot.emmanuel@gmail.com wrote:
> I prefer to return a key in the "for..of" loop case, because with a map you
> can always go from key->element. The opposite might not be true.
The main purpose of iteration is not to use keys and thus to avoid to
the overhead of key-to-element mapping and, possibly, the volatility of
keys.
Actually in most cases there should no iterators at all but an array
view of the container instead. Iterators is a necessary evil of
half-containers like lists, graphs etc.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2018-05-07 7:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-05 8:43 Trait based containers Luke A. Guest
2018-05-05 16:03 ` Jere
2018-05-07 7:02 ` briot.emmanuel
2018-05-07 7:14 ` Dmitry A. Kazakov [this message]
2018-05-07 7:00 ` briot.emmanuel
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox