M
Minkoo Seo
Hi list.
I'm trying to extract values from my map. Here's the code:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/if.hpp>
using namespace std;
using namespace boost::lambda;
int main()
{
map<string, int> m;
m["a"] = 1;
m["b"] = 2;
for_each(m.begin(), m.end(), cout << _1.second);
return EXIT_SUCCESS;
}
This code does not compile and says:
[mkseo@uranus tmp]$ !g
g++ lambda_test.cpp
lambda_test.cpp: In function 'int main()':
lambda_test.cpp:20: error: 'const struct
boost::lambda::lambda_functor<boost::lambda:laceholder<1> >' has no
member named 'second'
Where's my second?
Sincerely,
Minkoo Seo
I'm trying to extract values from my map. Here's the code:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/if.hpp>
using namespace std;
using namespace boost::lambda;
int main()
{
map<string, int> m;
m["a"] = 1;
m["b"] = 2;
for_each(m.begin(), m.end(), cout << _1.second);
return EXIT_SUCCESS;
}
This code does not compile and says:
[mkseo@uranus tmp]$ !g
g++ lambda_test.cpp
lambda_test.cpp: In function 'int main()':
lambda_test.cpp:20: error: 'const struct
boost::lambda::lambda_functor<boost::lambda:laceholder<1> >' has no
member named 'second'
Where's my second?
Sincerely,
Minkoo Seo