Binary C++ Sequence Methods

The following binary C++ Sequence methods and operators take a single argument other, perform the indicated operation on the object's sequence elements as the left operand and the other sequence elements as the right operand. They return a result sequence of the same type.

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

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

The following table lists the available comparison operators:

Sequence<T> operator +(Sequence<T> const& other) const

Add elements in left and right

Sequence<T> operator -(Sequence<T> const& other) const Subtract elements in right from left
Sequence<T> operator *(Sequence<T> const& other) const Multiply elements in left and right
Sequence<T> operator /(Sequence<T> const& other) const Divide elements in left by right
Sequence<T> operator %(Sequence<T> const& other) const Modulo of elements in left by elements in right
Sequence<T> max(Sequence<T> const& other) const; Maximum of the corresponding elements in left and right
Sequence<T> min(Sequence<T> const& other) const; Minimum of the corresponding elements in left and right

Example

Following is an example code snippet demonstrating a binary method:

         
    {
        ...
        Sequence<float> high = quote.high_iterator();
        Sequence<float> low = quote.low_iterator();
        Sequence<mco_seq_bool> diff = high - low;
        ...
    }