Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2005-04-21 09:03:15


"Thorsten Ottosen" <nesotto_at_[hidden]> wrote in message
news:d48a18$pmi$1_at_sea.gmane.org...
| "Fredrik Blomqvist" <fredrik_blomqvist_at_[hidden]> wrote in message

|| > Thorsten, I guess, decided not to have comparison operators at all.
|
| no.
|
|| My post was trigged by a note in the docs(?) suggesting they were supposed
|| to be added. But now I can't seem to find a link to it again...
|| (perhaps Thorsten updated some docs very recently?)
|
| well, yeah, the cvs docs are almost up to date.
|
| anyway, the comparison operators are implemented as members using
| boost.operators.
|
| I'll opdate the test to test these operators.

Actually there was already a test in ptr_vector.cpp:

    assign::push_back( vec )( new int(2) )
                            ( new int(4) )
                            ( new int(6) )
                            ( new int(8) );
    ptr_vector<int> vec2;
    assign::push_back( vec2 )
                        ( new int(1) )
                        ( new int(3) )
                        ( new int(5) )
                        ( new int(7) );
    BOOST_CHECK( vec < vec2 );
    BOOST_CHECK( vec != vec2 );
    BOOST_CHECK( !(vec == vec2 ) );
    BOOST_CHECK( vec2 > vec );
    BOOST_CHECK( vec <= vec2 );
    BOOST_CHECK( vec2 >= vec );

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk