Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 378615b

Browse files
authored
Merge pull request #1808 from somzzz/arrayEq
Array Literal Overloads merged-on-behalf-of: Andrei Alexandrescu <andralex@users.noreply.github.com>
2 parents 1f292ca + dc10926 commit 378615b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/object.d

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3229,6 +3229,25 @@ template RTInfo(T)
32293229
enum RTInfo = null;
32303230
}
32313231

3232+
bool __equals(T1, T2, size_t n1)(auto ref T1[n1] lhs, T2[] rhs)
3233+
{
3234+
T1[] lhs1 = lhs;
3235+
return __equals(lhs1, rhs);
3236+
}
3237+
3238+
bool __equals(T1, T2, size_t n2)(T1[] lhs, auto ref T2[n2] rhs)
3239+
{
3240+
T2[] rhs1 = rhs;
3241+
return __equals(lhs, rhs1);
3242+
}
3243+
3244+
bool __equals(T1, T2, size_t n1, size_t n2)(auto ref T1[n1] lhs, auto ref T2[n2] rhs)
3245+
{
3246+
T1[] lhs1 = lhs;
3247+
T2[] rhs1 = rhs;
3248+
return __equals(lhs1, rhs1);
3249+
}
3250+
32323251
// lhs == rhs lowers to __equals(lhs, rhs) for arrays of all struct types.
32333252
// old path: Typeinfo_array => TypeInfo_struct
32343253
bool __equals(T1, T2)(T1[] lhs, T2[] rhs)

0 commit comments

Comments
 (0)