I try to understand the following example given here:
template<class SinglePassRange1, class SinglePassRange2>
std::pair <
typename range_iterator<SinglePassRange1>::type,
typename range_iterator<const SinglePassRange2>::type
>
mismatch(SinglePassRange1& rng1, const SinglePassRange2& rng2);
And here is the description:
mismatch finds the first position where the correseponding elements from the two ranges rng1 and rng2 are not equal.
The main thing that is not clear to me in the above example is: What is given as an input and what is an output of the mismatch function?
rng1
and rng2
are object of classes SinglePassRange1
and SinglePassRange2
, respectively. But what are these classes? Where are they defined? They are supposed to be "ranges" but what are "ranges"?
It is also not clear to me what all these lines before the calling of the mismatch
function do. The first line looks like we are going to define a class template, but we do not do it later.