Boost logo

Boost Users :

From: Programmer_blabla (Programmer_blabla_at_[hidden])
Date: 2004-01-17 05:58:39


Ok thank you, I will post this on microsoft.public.vc.language.

About the other thing, I originally thinked about that. But what to
specifiy, using the typedef's won't work either (see below):

int i;
boost::tuple<int> data(27);

i = boost::tuples::get<0, boost::tuple<int>::head_type,
boost::tuple<int>::tail_type>(data); //ok
i = boost::bind(&boost::tuples::get<0, boost::tuple<int>::head_type,
boost::tuple<int>::tail_type>, _1)(data); //error

With kind regards,
me

----- Original Message -----
From: "Ben Hutchings" <ben.hutchings_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.user
Sent: Friday, January 16, 2004 1:30 PM
Subject: RE: tuple problems

> programmer blabla <programmer_blabla_at_[hidden]> wrote:
> > Dear Booster's
>
> Booster's what?
>
> > I have a problem compiling a tuple containing an enum in a
> > namespace. For example:
> >
> > namespace TestTuple
> > {
> > enum ETestTuple
> > {
> > eTestTuple0 = 0,
> > eTestTuple1 = 1
> > };
> > }
> >
> > void Testtuple5()
> > {
> > typedef boost::tuple<TestTuple::ETestTuple> Tuple;
> > Tuple tpl;
> > }
> >
> > does not compile. I am using MSVC 2003.net (7.1 version),
> > just native code. Is this a M$ problem or is tuple broken?
>
> Looks like a compiler bug to me.
>
> > Also I get problem with
> > the combination
> > of boost::bind and tuple, for example:
> >
> > int i;
> > boost::tuple<int> data;
> >
> > i = data.get<0>(); //ok
> > i = boost::tuples::get<0>(data); //ok
> > i = boost::bind(&boost::tuples::get<0>, _1)(data); //error
> >
> > Has anyone a clue?
>
> boost::tuples::get has three template parameters - index, head type
> and tail type. Usually the type arguments can be deduced, but since
> you're passing the address to another template function you need to
> specify all three arguments.
>
> > Btw searching lists.boost.org is very hard, because google
> > is out of sync with the list.
>
> Try <http://news.gmane.org/index.php?prefix=gmane.comp.lib.boost>
> instead.


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