On 1/1/15 7:32 AM, Idan Arye wrote:
If I have an associative array and I only modify it's values, without
changing the keys, can I assume that the order won't change?
I would never make that assumption. An AA is free to rehash at any time,
for whatever reason.
What I would say is that you ca
On Thursday, 1 January 2015 at 18:58:04 UTC, Andrej Mitrovic via
Digitalmars-d-learn wrote:
On 1/1/15, Tobias Pankrath via Digitalmars-d-learn
wrote:
You could implement an OrderedMap!(Key, Value) via
RedBlackTree!(Tuple!(Key, Value), (a,b) => a[0] < b[0]).
We could add this as an alias into
On Thursday, 1 January 2015 at 18:58:04 UTC, Andrej Mitrovic via
Digitalmars-d-learn wrote:
On 1/1/15, Tobias Pankrath via Digitalmars-d-learn
wrote:
You could implement an OrderedMap!(Key, Value) via
RedBlackTree!(Tuple!(Key, Value), (a,b) => a[0] < b[0]).
We could add this as an alias into
On Thu, 01 Jan 2015 12:32:33 +
Idan Arye via Digitalmars-d-learn
wrote:
> If I have an associative array and I only modify it's values,
> without changing the keys, can I assume that the order won't
> change?
please, don't: this is implementation-specific. druntime code can
change (for exam
On 1/1/15, Tobias Pankrath via Digitalmars-d-learn
wrote:
> You could implement an OrderedMap!(Key, Value) via
> RedBlackTree!(Tuple!(Key, Value), (a,b) => a[0] < b[0]).
We could add this as an alias into Phobos or perhaps as just a
documentation line on the website.
On Thursday, 1 January 2015 at 18:08:52 UTC, Andrej Mitrovic via
Digitalmars-d-learn wrote:
On 1/1/15, H. S. Teoh via Digitalmars-d-learn
wrote:
If you need consistent ordering of values, you probably want a
different
data structure, like an ordered map
This one works nicely on D1, I'd imagi
On 1/1/15, H. S. Teoh via Digitalmars-d-learn
wrote:
> If you need consistent ordering of values, you probably want a different
> data structure, like an ordered map
This one works nicely on D1, I'd imagine the D2 port works just the same:
https://github.com/SiegeLord/Tango-D2/blob/d2port/tango/
On Thu, Jan 01, 2015 at 04:17:39PM +, Idan Arye via Digitalmars-d-learn
wrote:
[...]
> My use case is that I have a large AA where the values are numbers and
> the keys are strings, and I need to send it over network again and
> again. The values constantly change but the keys should remain th
On 1/1/15, Peter Alexander via Digitalmars-d-learn
wrote:
> The order is unspecified, but an iteration must iterate in *some*
> order. The question (if I've understood it correctly), is whether
> that order of iteration changes when the keys aren't changed.
Hmm yeah, that definitely wasn't ever s
On Thursday, 1 January 2015 at 13:39:57 UTC, Peter Alexander
wrote:
On Thursday, 1 January 2015 at 13:13:10 UTC, Andrej Mitrovic
via Digitalmars-d-learn wrote:
On 1/1/15, Idan Arye via Digitalmars-d-learn
wrote:
If I have an associative array and I only modify it's values,
without changing the
On Thursday, 1 January 2015 at 13:13:10 UTC, Andrej Mitrovic via
Digitalmars-d-learn wrote:
On 1/1/15, Idan Arye via Digitalmars-d-learn
wrote:
If I have an associative array and I only modify it's values,
without changing the keys, can I assume that the order won't
change?
Associative arrays
On 1/1/15, Idan Arye via Digitalmars-d-learn
wrote:
> If I have an associative array and I only modify it's values,
> without changing the keys, can I assume that the order won't
> change?
Associative arrays are not ordered at all.
See the first note here: http://dlang.org/hash-map.html
If I have an associative array and I only modify it's values,
without changing the keys, can I assume that the order won't
change?
13 matches
Mail list logo