count_if(a,a+50,[](int i){return ~i&1;});
Например,
#include <iostream>
#include <numeric>
#include <algorithm>
using namespace std;
int main(){int a[50]; iota(a,a+50,1); cout<<count_if(a,a+50,[](int i){return ~i&1;});}