tmp/tmpl87l_ww4/{from.md → to.md}
RENAMED
|
@@ -6,23 +6,39 @@ template<class ForwardIterator1, class ForwardIterator2>
|
|
| 6 |
ForwardIterator2 first2);
|
| 7 |
template<class ForwardIterator1, class ForwardIterator2,
|
| 8 |
class BinaryPredicate>
|
| 9 |
bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
|
| 10 |
ForwardIterator2 first2, BinaryPredicate pred);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
```
|
| 12 |
|
| 13 |
-
*Requires:*
|
| 14 |
same value type. The comparison function shall be an equivalence
|
| 15 |
relation.
|
| 16 |
|
| 17 |
-
*
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
`ForwardIterator2 begin`, such that `equal(first1, last1, begin)`
|
| 20 |
returns `true` or `equal(first1, last1, begin, pred)` returns `true`;
|
| 21 |
otherwise, returns `false`.
|
| 22 |
|
| 23 |
-
*Complexity:*
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
`
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
|
|
|
| 6 |
ForwardIterator2 first2);
|
| 7 |
template<class ForwardIterator1, class ForwardIterator2,
|
| 8 |
class BinaryPredicate>
|
| 9 |
bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
|
| 10 |
ForwardIterator2 first2, BinaryPredicate pred);
|
| 11 |
+
template<class ForwardIterator1, class ForwardIterator2>
|
| 12 |
+
bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
|
| 13 |
+
ForwardIterator2 first2, ForwardIterator2 last2);
|
| 14 |
+
template<class ForwardIterator1, class ForwardIterator2,
|
| 15 |
+
class BinaryPredicate>
|
| 16 |
+
bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
|
| 17 |
+
ForwardIterator2 first2, ForwardIterator2 last2,
|
| 18 |
+
BinaryPredicate pred);
|
| 19 |
```
|
| 20 |
|
| 21 |
+
*Requires:* `ForwardIterator1` and `ForwardIterator2` shall have the
|
| 22 |
same value type. The comparison function shall be an equivalence
|
| 23 |
relation.
|
| 24 |
|
| 25 |
+
*Remarks:* If `last2` was not given in the argument list, it denotes
|
| 26 |
+
`first2 + (last1 - first1)` below.
|
| 27 |
+
|
| 28 |
+
*Returns:* If `last1 - first1 != last2 - first2`, return `false`.
|
| 29 |
+
Otherwise return `true` if there exists a permutation of the elements in
|
| 30 |
+
the range \[`first2`, `first2 + (last1 - first1)`), beginning with
|
| 31 |
`ForwardIterator2 begin`, such that `equal(first1, last1, begin)`
|
| 32 |
returns `true` or `equal(first1, last1, begin, pred)` returns `true`;
|
| 33 |
otherwise, returns `false`.
|
| 34 |
|
| 35 |
+
*Complexity:* No applications of the corresponding predicate if
|
| 36 |
+
`ForwardIterator1` and `ForwardIterator2` meet the requirements of
|
| 37 |
+
random access iterators and `last1 - first1 != last2 - first2`.
|
| 38 |
+
Otherwise, exactly `distance(first1, last1)` applications of the
|
| 39 |
+
corresponding predicate if `equal(first1, last1, first2, last2)` would
|
| 40 |
+
return `true` if `pred` was not given in the argument list or
|
| 41 |
+
`equal(first1, last1, first2, last2, pred)` would return `true` if pred
|
| 42 |
+
was given in the argument list; otherwise, at worst 𝑂(N^2), where N has
|
| 43 |
+
the value `distance(first1, last1)`.
|
| 44 |
|