Ask Your Question
3

What does the "'operator<' error mean when using operator overloading for the sort() function on a vector?

asked 2021-06-03 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-02-05 03:00:00 +0000

devzero gravatar image

The "operator<" error occurs when the overloaded comparison operator used in the sort() function for a vector is not defined properly or is missing. The sort() function needs to know how to compare the elements in the vector to be able to sort them. If the comparison operator is not properly overloaded, the function will be unable to compare the elements and sort the vector.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-06-03 11:00:00 +0000

Seen: 12 times

Last updated: Feb 05 '22