Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "In C++23, what happens when a class defines auto operator<=>(const T&) const = default; and declares no operator==?" on CodeWiki (https://codewiki.com/practice/mcq/cpp/operator-overloading/defaulted-three-way-equality/).
Context (verbatim from the page):
"""
In C++23, what happens when a class defines auto operator<=>(const T&) const = default; and declares no operator==?
A matching defaulted operator== is declared implicitly.
Equality is unavailable until operator== is written by hand.
operator== compares object addresses.
The declaration is valid only for classes with one data member.
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in C++. Where you are unsure, say so.