Skip to content

Commit

Permalink
ae.sys.data: Add comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberShadow committed Feb 4, 2024
1 parent 5edeb97 commit b04124e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sys/data.d
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,10 @@ public:
}
}

bool opEquals(ref TData other) const { return data == other.data; }
bool opEquals(TData other) const { return data == other.data; }
bool opEquals(scope T[] other) const { return data == other; }

package(ae) // ditto
static if (is(T == ubyte))
deprecated sizediff_t indexOf(const(void)[] needle) const
Expand Down Expand Up @@ -952,6 +956,12 @@ unittest
d.length = d.capacity + 1;
assert(d.unsafeContents.ptr != oldContents.ptr);
}
// Equality
{
auto d1 = generator();
auto d2 = generator();
assert(d1 == d2);
}
// Concatenation
{
void test(L, R)(L left, R right)
Expand Down

0 comments on commit b04124e

Please sign in to comment.