"Davis King" <> 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