View source code
Display the source code in std/typecons.d from which this page was generated on
github.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
local clone.
Page wiki
View or edit the community-maintained wiki page associated with this page.
Template std.typecons.Tuple.opEquals
Comparison for equality. Two
s are considered equal
iff they fulfill the following criteria:
Tuple
- Each
is the same length.Tuple
- For each type
T
on the left-hand side and each typeU
on the right-hand side, values of typeT
can be compared with values of typeU
. - For each value
v1
on the left-hand side and each valuev2
on the right-hand side, the expressionv1 == v2
is true.
Arguments
template opEquals(R);
Functions
Function name | Description |
---|---|
opEquals |
Parameters
Name | Description |
---|---|
rhs | The to compare against. It must meeting the criteria
for comparison between s. |
Returns
true if both
s are equal, otherwise false.
Tuple
Example
Tuple!(int, string) t1 = tuple(1, "test"); Tuple!(double, string) t2 = tuple(1.0, "test"); //Ok, int can be compared with double and //both have a value of 1 assert(t1 == t2);
Authors
Andrei Alexandrescu, Bartosz Milewski, Don Clugston, Shin Fujishiro, Kenji Hara