diff --git a/hash/doc/hash.qbk b/hash/doc/hash.qbk index d68e765..eb574d6 100644 --- a/hash/doc/hash.qbk +++ b/hash/doc/hash.qbk @@ -209,7 +209,7 @@ Say you have a point class, representing a two dimensional location: bool operator==(point const& other) const { - return x = other.x && y == other.y; + return x == other.x && y == other.y; } }; diff --git a/hash/examples/point.cpp b/hash/examples/point.cpp index 30e6080..b295cc5 100644 --- a/hash/examples/point.cpp +++ b/hash/examples/point.cpp @@ -20,7 +20,7 @@ public: 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) @@ -49,3 +49,4 @@ int main() assert(point_hasher(p1) != point_hasher(p2)); assert(point_hasher(p1) != point_hasher(p3)); } +