
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-
"Brian Braatz" <brianb@rmtg.com> 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