Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-03-30 15:35:30


"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.

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.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.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