Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re: std::rel_ops

Reply
Thread Tools

Re: std::rel_ops

 
 
Victor Bazarov
Guest
Posts: n/a
 
      07-01-2003
"Davis King" <(E-Mail Removed)-state.edu> wrote...
>
>
> Davis King wrote:
> > Why aren't the templates in std::rel_ops implemented like
> > template <typename A, typename B> bool operator> (const A& a, const B&
> > b) { return b < a; }
> > ?

>
> Let explain what my problem is exactly.
> I'm making a bigint object and I have operator<(const bigint&) and then
> two global friends called operator<(int,const bigint&) and
> operator<(const bigint&,int).
>
> I also have similar operator== functions.
>
>
> Anyways.
> my problem is that the std::rel_ops operators only work when the types
> being compared are the same. So if I create the above templated compare
> then everything SEEMS to work just fine and I can compare my bigints to
> ints all I please. However, since the rel:ps aren't implemented
> this way it makes me worried that there is some bizarre behavior caused
> by doing this that I don't know about.
>
> So am I worried over nothing?


Could be. The best place to ask for rationale behind some Standard
definitions is comp.std.c++. [ I thought you knew ]

Victor


 
Reply With Quote
 
 
 
 
Davis King
Guest
Posts: n/a
 
      07-01-2003


Victor Bazarov wrote:
> "Davis King" <(E-Mail Removed)-state.edu> wrote...
>
>>

> Could be. The best place to ask for rationale behind some Standard
> definitions is comp.std.c++. [ I thought you knew ]
>


I know now. Thanks


 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments