Boost logo

Boost Users :

Subject: Re: [Boost-users] Typedef rejected when disambiguating a call to boost::assign
From: mark pashley (mark.pashley_at_[hidden])
Date: 2012-10-30 06:20:29


Not had a chance to try it on any other compilers yet ( I haven't got
anything else available at work).

Here is the entire example if anyone is interested in trying it on another
compiler...

#include <set>
#include <map>
#include <algorithm>
#include <iterator>

#include <boost/assign/list_of.hpp>

typedef std::set< unsigned > the_set_t;
typedef std::map< unsigned, the_set_t > the_map_t;

// switch these lines to get the example to compile.....
the_map_t data = boost::assign::map_list_of< uint32_t, the_set_t > >
// the_map_t data = boost::assign::map_list_of< unsigned, std::set< unsigned
> >
    ( 1, boost::assign::list_of(10)(20)(30) )
    ( 2, boost::assign::list_of(12)(22)(32) )
    ( 3, boost::assign::list_of(13)(23)(33) )
    ( 4, boost::assign::list_of(14)(24)(34) )
    ;

int main( int, char** )
{
    the_map_t::const_iterator iter = data.begin();
    the_map_t::const_iterator fin = data.end();

    for (; iter != fin; ++iter )
    {
        std::cout << "Index: " << iter->first << " { ";
        std::copy( iter->second.begin(), iter->second.end(),
                   std::ostream_iterator<unsigned>( std::cout, " " ) );
        std::cout << "}\n";
    }

    return 0;
}

--
View this message in context: http://boost.2283326.n4.nabble.com/Typedef-rejected-when-disambiguating-a-call-to-boost-assign-tp4637775p4637779.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net