Q:

Use std::count to count equal values in a pair of arrays

Given a pair of equal length arrays . .  
void someFunc (const float **inputChannelData)
{
    const float* L = inputChannelData[0];
    const float* R = inputChannelData[1];
    ...

I can see that it is pretty easy to count the number of occurrences of a constant value using std::count  . . 
std::count(L, L+someIntegerOffset, 0.0f)

... but is there a standard algorithm (or idiom) that counts the element-wise (same index in each array) number of identical values in two arrays? 
A Matlab equivalent would look like sum(L==R)

A:

std::count has a predicate form std::count_if, and documentation suggest it gets the argument by lvalue.
So I believe I could hack together a lambda that captures the two arrays, from &arg gets the distance/index, then checks both values.  I doubt I would use it that way though instead of old-fashioned for loop.

