Skip to content

Commit

Permalink
Let HashMap.byValue return elements by ref.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Jul 15, 2024
1 parent 01c1b51 commit e58f8d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/vibe/container/hashmap.d
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ struct HashMap(TKey, TValue, Traits = DefaultHashMapTraits!TKey, Allocator = IAl

auto byKey() { return bySlot.map!((ref e) => e.key); }
auto byKey() const { return bySlot.map!((ref e) => e.key); }
auto byValue() { return bySlot.map!((ref e) => e.value); }
auto byValue() const { return bySlot.map!((ref e) => e.value); }
auto byValue() { return bySlot.map!(ref(ref e) => e.value); }
auto byValue() const { return bySlot.map!(ref(ref e) => e.value); }
auto byKeyValue() { import std.typecons : Tuple; return bySlot.map!((ref e) => Tuple!(Key, "key", Value, "value")(e.key, e.value)); }
auto byKeyValue() const { import std.typecons : Tuple; return bySlot.map!((ref e) => Tuple!(const(Key), "key", const(Value), "value")(e.key, e.value)); }

Expand Down

0 comments on commit e58f8d2

Please sign in to comment.