[assign] Nested initialization of std containers
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
Joseph Lisee skrev:
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
using namespace boost::assign;
typedef std::map
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"));
try list l2 = list_of<dict>( ... ) -Thorsten
participants (2)
-
Joseph Lisee
-
Thorsten Ottosen