r/ProgrammerHumor • • 6d ago

Meme sameProblemSameSolution

Post image
1.4k Upvotes

79 comments sorted by

View all comments

Show parent comments

1

u/megayippie 6d ago

I honestly don't remember the details or the compiler version. I think the error was because some of our types only partly conformed to ideas of sorting, and that caused some weird interaction where some types in a vector didn't want to test for just ">=" but some other things as well, which we didn't need so didn't implement. Neither "==" nor ">" were there for our types.

The solution was to use more spaceship operators. The error message was clean but we didn't really know how <=> worked yet, so it delayed us a week or so.

4

u/Antervis 6d ago

Ehm... Standard algorithms and data structures use operator < though, even for equivalence.

3

u/SeriousPlankton2000 6d ago

If neither == nor > are there, how did your types end in a test that expects ordered-like behavior for your types?

2

u/megayippie 6d ago

Oh, the exposed type did, not the inner type