2 Copyright 2010 Neil Groves
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
12 class SinglePassRange1,
13 class SinglePassRange2
15 bool equal(const SinglePassRange1& rng1,
16 const SinglePassRange2& rng2);
19 class SinglePassRange1,
20 class SinglePassRange2,
23 bool equal(const SinglePassRange1& rng1,
24 const SinglePassRange2& rng2,
25 BinaryPredicate pred);
30 `equal` returns `true` if `distance(rng1)` is equal to the `distance(rng2)` and for each element `x` in `rng1`, the corresponding element `y` in `rng2` is equal. Otherwise `false` is returned.
32 In this range version of `equal` it is perfectly acceptable to pass in two ranges of unequal lengths.
34 Elements are considered equal in the non-predicate version if `operator==` returns `true`. Elements are considered equal in the predicate version if `pred(x,y)` is `true`.
38 Defined in the header file `boost/range/algorithm/equal.hpp`
40 [heading Requirements]
42 [*For the non-predicate versions:]
44 * `SinglePassRange1` is a model of the __single_pass_range__ Concept.
45 * `SinglePassRange2` is a model of the __single_pass_range__ Concept.
46 * `SinglePassRange1`'s value type is a model of the `EqualityComparableConcept`.
47 * `SinglePassRange2`'s value type is a model of the `EqualityComparableConcept`.
48 * `SinglePassRange1`'s value type can be compared for equality with `SinglePassRange2`'s value type.
50 [*For the predicate versions:]
52 * `SinglePassRange1` is a model of the __single_pass_range__ Concept.
53 * `SinglePassRange2` is a model of the __single_pass_range__ Concept.
54 * `BinaryPredicate` is a model of the `BinaryPredicateConcept`.
55 * `SinglePassRange1`'s value type is convertible to `BinaryPredicate`'s first argument type.
56 * `SinglePassRange2`'s value type is convertible to `BinaryPredicate`'s second argument type.
60 Linear. At most `min(distance(rng1), distance(rng2))` comparisons.