Skip to content

Commit f0d6b58

Browse files
committed
Fix using keys with indirections
1 parent c0e932a commit f0d6b58

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/containers/hashmap.d

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,3 +790,9 @@ version(emsi_containers_unittest) unittest
790790
static struct S { @disable this(this); }
791791
alias HM = HashMap!(int, S);
792792
}
793+
794+
version(emsi_containers_unittest) unittest
795+
{
796+
struct S { int* a; }
797+
alias HM = HashMap!(S, int);
798+
}

src/containers/internal/hash.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static if (hash_t.sizeof == 4)
1515
}
1616
else
1717
{
18-
hash_t generateHash(T)(T value) if (!is(T == string))
18+
hash_t generateHash(T)(const T value) if (!is(T == string))
1919
{
2020
return hashOf(value);
2121
}

0 commit comments

Comments
 (0)