Boost logo

Boost Users :

From: Brian Braatz (brianb_at_[hidden])
Date: 2005-03-30 20:38:41


> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
>
> "Brian Braatz" <brianb_at_[hidden]> writes:
>
> > I can always pass in a functor, but what I really want for Christmas
is
> > to be able to
> >
> > Tyepdef MyClass<std::ofstream,
> > bind(&std::ofstream::open,_1,"MyFile.txt") > MyNewClass;
> >
> > This doesn't work because bind returns an actual OBJECT instead of a
> > type. (intuitively - it would be cool if I could say
> > bind(...)::Type which would give me the TYPE of the generated
> > functor)
> >
> > SO that led me to be up until 3 am reading about mpl::lambda. I am
still
> > trying to determine if THAT can be used in place, but the dots are
not
> > connecting for me yet.
> >
> > Any suggestions or directions pointed GREATLY appreciated.
>
[Dave Abrahams Writes:]
> You want "typeof," a mythical operator not yet in the C++ language --
> but many implementations support some form of it as an extension.
> There's a prototype typeof library in the Sandbox files area now, by
> Arkadiy Vertleyb and others. Check it out. I suggest you browse the
> recent thread on typeof in boost-devel as well.

[Brian Braatz Writes:]

As always THANK YOU Dave

What about the boost\Lambda.bind vs MPL bind?. Is there a way to write
the

Tyepdef MyClass<std::ofstream,bind(&std::ofstream::open,_1,"MyFile.txt")
MyNewClass;

As a MPL driven expression, or is the "typeof" the only option (I am
ignoring the hand coded functor option). (I am asking partially because
I am having a hard time "seeing" the difference between the MPL lambda
and the boost lambda- I will keep re-reading the MPL book... :) )
(also don't get me wrong, the typeof looks very cool- I am just trying
to connect the dots)

ALSO I REALLY WISH I could pass strings to templates, maybe if I am
lucky Santa will join the C++ committee.......

Thanks again

Brian


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