LearnFrenzy
Sign in Take a free test

Classes and Objects · Classes and Objects MCQ · Question 17

What does a defaulted operator<=> give you? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 17 Back to Exercise

What does auto operator<=>(const Version&) const = default; provide?

  • A Only ==
  • B All six comparison operators, comparing members in declaration order Correct
  • C Only &lt; for sorting
  • D Hashing
Correct Answer: Option B

A defaulted <=> also implicitly declares a defaulted ==, so ==, !=, <, <=, >, >= all work.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links