Comparison operators

J

Joe Van Dyk

Say I want to define all the operator==, operator!=, operator<=,
operator>, etc for a class.

I could've sworn there was a library (maybe in Boost) that helped me do
this (so I don't have to define all of them by hand).
Was I imagining it?

Thanks,
Joe
 
V

Victor Bazarov

Joe said:
Say I want to define all the operator==, operator!=, operator<=,
operator>, etc for a class.

So, define them. What's stopping you?
I could've sworn there was a library (maybe in Boost) that helped me
do this (so I don't have to define all of them by hand).
Was I imagining it?

Quite possible. What kind of "help" do you expect?

V
 
J

Joe Van Dyk

So, define them. What's stopping you?

Because in most cases, defining all of them duplicates knowledge. Which I
try to avoid. And it's tedious and boring.
Quite possible. What kind of "help" do you expect?

A way for me to specify the results of a couple of the operators, and have
the others generated through some means.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top