Hi,
I am working with STL and found a problem with using binders.
The code I am using is as follow:
Code:
#include <iostream>
#include <functional>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<string> vecstr;
vecstr.push_back("aaaa");
vecstr.push_back("bbbb");
vecstr.push_back("zzzz");
vecstr.push_back("bbbb");
int d = ( int ) count_if(vecstr.begin(), vecstr.end(), bind1st(equal_to(),"bbbb") );
cout << "\n d = " << d << endl;
}
It's giving me error :
binder.cpp:17: error: missing template arguments before ‘(’ token
I have copy this example from net to learn Binders.
Thanks