Comparison C++ Sequence Methods

The following comparison C++ Sequence operators take a single argument other, and perform the indicated comparison of the object's sequence elements as the left operand and the other sequence elements as the right operand. They return a Boolean result Sequence (specifically of type mco_seq_bool).

The method signatures are of the following form (where op is the indicated operation):

 
    Sequence<mco_seq_bool> operator op(Sequence<T> const& other) const;
             

The following table lists the available comparison operators:

Sequence<mco_seq_bool> operator ==(Sequence<T> const& other) const The element of the result sequence is true for corresponding elements that are equal in the left and right sequences; otherwise false
Sequence<mco_seq_bool> operator !=(Sequence<T> const& other) const The element of the result sequence is true for corresponding elements that are not equal in the left and right sequences; otherwise false
Sequence<mco_seq_bool> operator >(Sequence<T> const& other) const The element of the result sequence is true for corresponding elements where the left element is greater than the right; otherwise false
Sequence<mco_seq_bool> operator >=(Sequence<T> const& other) const The element of the result sequence is true for corresponding elements where the left element is greater than or equal to the right; otherwise false
Sequence<mco_seq_bool> operator <(Sequence<T> const& other) const The element of the result sequence is true for corresponding elements where the left element is less than the right; otherwise false
Sequence<mco_seq_bool> operator <=(Sequence<T> const& other) const The element of the result sequence is true for corresponding elements where the left element is less than or equal to the right; otherwise false

Example

Following is an example code snippet demonstrating a comparison operator:

         
    {
        ...
        Sequence<float> open= quote.open_iterator();
        Sequence<float> close = quote.close_iterator();
        Sequence<mco_seq_bool> daysUp = close > open;
        ...
    }