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:
cxl 2013-12-13 08:30:32 +00:00
parent 9a2ad5451b
commit c2fb80288b

View file

@ -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 << ')'; }
};