Skip to content

Commit 1dde458

Browse files
committed
add opequals
1 parent 9e56a82 commit 1dde458

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

source/mir/string_map.d

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ struct StringMap(T, U = uint)
3939
private alias Impl = StructImpl!(T, U);
4040
private Impl* implementation;
4141

42+
///
43+
bool opEquals()(const StringMap rhs) const
44+
{
45+
return keys == rhs.keys && values == rhs.values;
46+
}
47+
4248
// // linking bug
4349
// version(none)
4450
// {
@@ -713,6 +719,8 @@ unittest
713719
assert(table.values == [3, 11]);
714720
assert(table["L"] == 3);
715721
assert(table["val"] == 11);
722+
723+
assert(table == table);
716724
}
717725

718726
private struct StructImpl(T, U = uint)

0 commit comments

Comments
 (0)