
18 Feb
2009
18 Feb
'09
4:36 p.m.
I am trying to use list_of and map_list_of to initialize a std::vector containing std::maps. I am using Boost 1.37 and Mac OS X 10.4 with Apple's G++ 4.0.1. Here is a complete example: #include <vector> #include <map> #include <string> #include <boost/assign/list_of.hpp> using namespace boost::assign; typedef std::map<int, std::string> dict; typedef std::vector<dict> list; int main() { // Works dict d = map_list_of(1,"B")(2,"A"); list l1 = list_of(d); // Does not compile list l2 = list_of(map_list_of(1,"B")(2,"A")); return 0; } Is there some way to get this to work?