Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 10th, 2006, 03:55 AM
Joe Van Dyk
Guest
 
Posts: n/a
Default Comparison operators

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
  #2  
Old August 10th, 2006, 04:15 AM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: Comparison operators

Joe Van Dyk wrote:
Quote:
Say I want to define all the operator==, operator!=, operator<=,
operator>, etc for a class.
So, define them. What's stopping you?
Quote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


  #3  
Old August 10th, 2006, 02:15 PM
Michiel.Salters@tomtom.com
Guest
 
Posts: n/a
Default Re: Comparison operators


Joe Van Dyk wrote:
Quote:
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)
Would you be surprised if I told you it was Boost::operators?

http://www.boost.org/libs/utility/operators.htm

  #4  
Old August 10th, 2006, 09:15 PM
Joe Van Dyk
Guest
 
Posts: n/a
Default Re: Comparison operators

On Thu, 10 Aug 2006 06:19:13 -0700, Michiel.Salters wrote:
Quote:
>
Joe Van Dyk wrote:
Quote:
>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)
>
Would you be surprised if I told you it was Boost::operators?
>
http://www.boost.org/libs/utility/operators.htm
Ah, thanks. That looks like what I was looking for.

Joe

  #5  
Old August 10th, 2006, 09:15 PM
Joe Van Dyk
Guest
 
Posts: n/a
Default Re: Comparison operators

On Wed, 09 Aug 2006 23:24:10 -0400, Victor Bazarov wrote:
Quote:
Joe Van Dyk wrote:
Quote:
>Say I want to define all the operator==, operator!=, operator<=,
>operator>, etc for a class.
>
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.
Quote:
Quote:
>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?
A way for me to specify the results of a couple of the operators, and have
the others generated through some means.

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles