# Concept EqualityComparableConcept
A type that can be equality compared.

All Subcl's | BidirectionalIteratorConcept, ComparableConcept, FiniteOrderedAlphabetConcept, ForwardIteratorConcept, InputIteratorConcept, IntegerConcept, MutableBidirectionalIteratorConcept, MutableForwardIteratorConcept, MutableRandomAccessIteratorConcept, MutableRootedIteratorConcept, MutableRootedRandomAccessIteratorConcept, OrderedAlphabetConcept, RandomAccessIteratorConcept, RootedIteratorConcept, RootedRandomAccessIteratorConcept, SignedIntegerConcept, UnsignedIntegerConcept
Defined in | <seqan/basic.h>
Signature | `EqualityComparable<T>`

## Detailed Description

### Remarks

Expects instances of type `T` to be comparable via `operator==` and `operator!=`. Comparison operators must return boolean convertible values. `operator==` must be an equivalence relation.

### Examples

Valid expressions:

    a == b;
    a != b;

Invariants:

- `(a == a)` (reflexivity)
- `(a == b)` => `(b == a)` (symmetry)
- `(a == b) &&(b == c)` => `(a == c)` (transitivity)

## See Also

- ComparableConcept

## Member Function Overview

- `bool T::operator!=(T const & other) const;`
  Operator to compare for inequality.
- `bool T::operator==(T const & other) const;`
  Operator to compare for equality.

## Member Functions Detail

### `bool T::operator!=(T const & other) const;`

Operator to compare for inequality.

The inequality operator can be implemented as a member or as a global function.

Usually, the inequality operator is implemented as `!operator==(a, b)`.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### See Also

- operator==

### `bool T::operator==(T const & other) const;`

Operator to compare for equality.

The equality operator can be implemented as a member or as a global function.

Usually, there is an implementation of `operator==()` for custom data types and then `operator!=()` uses `operator==()`.

#### Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

#### See Also

- operator==

#### Dox Sources

    /*!
     * @concept EqualityComparableConcept
     *
     * @headerfile <seqan/basic.h>
     *
     * @brief A type that can be equality compared.
     *
     * @signature EqualityComparable<T>
     *
     * @section Remarks
     *
     * Expects instances of type <tt>T</tt> to be comparable via <tt>operator==</tt>
     * and <tt>operator!=</tt>. Comparison operators must return boolean convertible
     * values. <tt>operator==</tt> must be an equivalence relation.
     *
     * @section Examples
     *
     * Valid expressions:
     *
     * @code{.cpp}
     * a == b;
     * a != b;
     * @endcode
     *
     *
     * Invariants:
     *
     * <ul> <li><tt>(a == a)</tt> (reflexivity)</li> <li><tt>(a == b)</tt> => <tt>
     * (b == a)</tt> (symmetry)</li> <li> <tt>(a == b) &amp;&amp;(b == c)</tt> =>
     * <tt>(a == c)</tt> (transitivity)</li> </ul>
     *
     * @see ComparableConcept
     *
     * @fn EqualityComparableConcept::operator==
     *
     * @brief Operator to compare for equality.
     *
     * @signature bool T::operator==(T const & other) const;
     *
     * The equality operator can be implemented as a member or as a global function.
     *
     * Usually, there is an implementation of <tt>operator==()</tt> for custom data
     * types and then <tt>operator!=()</tt> uses <tt>operator==()</tt>.
     *
     * @see EqualityComparableConcept::operator==
     *
     * @fn EqualityComparableConcept::operator!=
     *
     * @brief Operator to compare for inequality.
     *
     * @signature bool T::operator!=(T const & other) const;
     *
     * The inequality operator can be implemented as a member or as a global
     * function.
     *
     * Usually, the inequality operator is implemented as <tt>!operator==(a,
     * b)</tt>.
     *
     * @see EqualityComparableConcept::operator==
     */