mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Core: Tuple[n] now has Serialize
git-svn-id: svn://ultimatepp.org/upp/trunk@6649 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9a2ad5451b
commit
c2fb80288b
1 changed files with 6 additions and 0 deletions
|
|
@ -13,6 +13,8 @@ struct Tuple2 {
|
|||
bool operator>(const Tuple2& x) const { return Compare(x) > 0; }
|
||||
|
||||
unsigned GetHashValue() const { return CombineHash(a, b); }
|
||||
|
||||
void Serialize(Stream& s) { s % a % b; }
|
||||
|
||||
String ToString() const { return String().Cat() << '(' << a << ", " << b << ')'; }
|
||||
};
|
||||
|
|
@ -49,6 +51,8 @@ struct Tuple3 {
|
|||
bool operator>(const Tuple3& x) const { return Compare(x) > 0; }
|
||||
|
||||
unsigned GetHashValue() const { return CombineHash(a, b, c); }
|
||||
|
||||
void Serialize(Stream& s) { s % a % b % c; }
|
||||
|
||||
String ToString() const { return String().Cat() << '(' << a << ", " << b << ", " << c << ')'; }
|
||||
};
|
||||
|
|
@ -89,6 +93,8 @@ struct Tuple4 {
|
|||
|
||||
unsigned GetHashValue() const { return CombineHash(a, b, c, d); }
|
||||
|
||||
void Serialize(Stream& s) { s % a % b % c % d; }
|
||||
|
||||
String ToString() const { return String().Cat() << '(' << a << ", " << b << ", " << c << ", " << d << ')'; }
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue