Pe*******@gmail.com wrote:

I'm wonder whether

1. stl directly defined the 6 comparison operators(== != < > <= >=)

directly for iterator and const_iterator

2. or it only define == and < and using std::rel_ops to get the other 4

operators.

Just a loosely related note on any operator<= and >=; the STL works with

the two basic principles of equality and equivalence. Usually it

requires an ordering corresponding to one of those concepts. With

equality you can only implement == and !=, and with equivalence only <

and >. Therefore the combination operators <= and >= require both the

concepts of equality and equivalence, and so are difficult to implement.

--

Regards,

Ferdi Smit (M.Sc.)

Email:

Fe********@cwi.nl
Room: C0.07 Phone: 4229

INS3 Visualization and 3D Interfaces

CWI Amsterdam, The Netherlands