Hi,
I am working with STL and found a problem with using binders.
The code I am using is as follow:
It's giving me error :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; }
I have copy this example from net to learn Binders.binder.cpp:17: error: missing template arguments before ‘(’ token
Thanks



LinkBack URL
About LinkBacks


