# Logical C++ Sequence Methods

> The following logical C++ Sequence operators (except the not operator "!") take a single argument `other`, and perform the indicated logical operation oo 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 function signatures are of the following two forms (where `op` is the indicated operation):

>         Sequence<mco_seq_bool> operator !() const;

> or

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

> where operator is one of the following:

> Sequence<mco_seq_bool> operator !() const | The element of the result sequence is the logical not of the corresponding element in the object's sequence
> Sequence<mco_seq_bool> operator &&(Sequence<mco_seq_bool> const& other) const | The element of the result sequence is the logical and of the corresponding elements in left and right
> Sequence<mco_seq_bool> operator ||(Sequence<mco_seq_bool> const& other) const | The element of the result sequence is the logical or of the corresponding elements in left and right
> Sequence<mco_seq_bool> operator ^(Sequence<mco_seq_bool> const& other) const | The element of the result sequence is the logical exclusive or of the corresponding elements in left and right

> ## Example

> Following is an example code snippet demonstrating logical operators :

>         {
>             ...
>             Sequence<float> high = quote.high_iterator();
>             Sequence<float> low = quote.low_iterator();
>             Sequence<mco_seq_bool> equal = high == low;
>             Sequence<mco_seq_bool> ne = !equal;
>             equal.reset();
>             Sequence<mco_seq_bool> allTrue = ne || equal;
>             ...
>         }