Boost logo

Boost Users :

From: Markus Werle (numerical.simulation_at_[hidden])
Date: 2008-08-20 09:14:11


Joel de Guzman <joel <at> boost-consulting.com> writes:

>
> Markus Werle wrote:
>
> > And this here fails:
> >
> > #include <boost/assign/list_of.hpp>
> > #include <boost/assign/list_inserter.hpp>
> > #include <boost/tr1/tuple.hpp>
> >
> > #include <list>
> >
> > int main(int argc, char* argv[])
> > {
> > typedef std::list<std::tr1::tuple<int, std::string> > mod_list_t;
> >
> > static mod_list_t const l =
> > boost::assign::tuple_list_of(1, "A")(2, "B");
> >
> > return 0;
> > }
> >
> >
> > Any hint?
>
> I'm not familiar with boost assign. Could you please provide a test
> case that does not use boost.assign?

Actually I played around with boost::assign and tried to fix this myself.
The problem is that boost::assign::tuple_list_of(...) returns something
that is convertibel to std::list<boost::tuple<int, string> >, but not
to std::list<std::tr1::::tuple<int, string> >.

Is it hard work and/or useful to make this compile?

---snip----
#include <boost/tr1/tuple.hpp>
#include <boost/tuple/tuple.hpp>

#include <string>
#include <list>

int main(int argc, char* argv[])
{
        typedef std::list<std::tr1::tuple<int, std::string> > list_t;
        typedef std::list<boost::tuple<int, std::string> > b_list_t;

        b_list_t bl;
        list_t l = bl;

        return 0;
}


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