mirror of
https://github.com/boostorg/functional.git
synced 2025-08-02 22:14:28 +02:00
Merge in fix to hash example/documentation from 1.33 branch.
[SVN r30610]
This commit is contained in:
@@ -209,7 +209,7 @@ Say you have a point class, representing a two dimensional location:
|
|||||||
|
|
||||||
bool operator==(point const& other) const
|
bool operator==(point const& other) const
|
||||||
{
|
{
|
||||||
return x = other.x && y == other.y;
|
return x == other.x && y == other.y;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@ public:
|
|||||||
|
|
||||||
bool operator==(point const& other) const
|
bool operator==(point const& other) const
|
||||||
{
|
{
|
||||||
return x = other.x && y == other.y;
|
return x == other.x && y == other.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
friend std::size_t hash_value(point const& p)
|
friend std::size_t hash_value(point const& p)
|
||||||
@@ -49,3 +49,4 @@ int main()
|
|||||||
assert(point_hasher(p1) != point_hasher(p2));
|
assert(point_hasher(p1) != point_hasher(p2));
|
||||||
assert(point_hasher(p1) != point_hasher(p3));
|
assert(point_hasher(p1) != point_hasher(p3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user