30 Oct
2012
30 Oct
'12
10:05 a.m.
On 30-10-2012 09:38, mark pashley wrote:
I am trying to initialise a std::map of std::set using boost::assign, as follows:
typedef std::set< uint32_t > the_set_t; typedef std::map< uint32_t, the_set_t > the_map_t;
the_map_t data = boost::assign::map_list_of< uint32_t, the_set_t > > // bad line ( 1, boost::assign::list_of(10)(20)(30) )
Unfortunately this is rejected by GCC 4.4.6, and results in a large amount of errors, (attached below).
The problem is caused by the use of the typedef the_set_t. If the typedef is replaced with std::set
the code compiles and works correctly.
I don't see how a typedef can change the code. Very wierd. Does it happen with other compilers? -Thorsten