cpp/algorithm/ranges/starts with

Checks whether the second range matches the prefix of the first range.

@1@ Let and  denote the size of ranges  and  respectively. If, returns. Otherwise, returns only if every element in the range  is equal to the corresponding element in. Comparison is done by applying the binary predicate to elements in two ranges projected by  and  respectively.

@2@ Same as, but uses and  as the source ranges, as if using  as ,  as ,  as , and  as.

Return value
if the second range matches the prefix of the first range, otherwise.

Complexity
Linear: at most applications of the predicate and both projections.