Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit c89e626766.
PrevUpHomeNext
equal
Description

Compare two sequences for equality.

Synopsis
template <typename Seq1, typename Seq2>
bool
operator==(Seq1 const& a, Seq2 const& b);
Parameters

Parameter

Requirement

Description

a, b

Instances of Sequence

Sequence(s) to compare

Expression Semantics
a == b

Return type: bool

Requirements:

For each element, e1, in sequence a, and for each element, e2, in sequence b, a == b is a valid expression returning a type that is convertible to bool.

An attempt to compare two Sequences of different lengths results in a compile time error.

Semantics:

For each element, e1, in sequence a, and for each element, e2, in sequence b, e1 == e2 returns true. For any 2 zero length Sequence(s), e and f, e == f returns true.

Header
#include <boost/fusion/sequence/comparison/equal_to.hpp>
#include <boost/fusion/include/equal_to.hpp>
Example
vector<int, char> v1(5, 'a');
vector<int, char> v2(5, 'a');
assert(v1 == v2);

PrevUpHomeNext