
Arkadiy Vertleyb wrote:
"Brian McNamara" <lorgon@cc.gatech.edu> wrote
On Mon, May 03, 2004 at 09:42:16AM -0400, Arkadiy Vertleyb wrote:
On the other hand, since a lambda expression returns a
default-constructed
functor (does it? -- I am unable to verify it right now) the above
doesn't
make a lot of sence for Lambda... One can just write:
BOOST_TYPEOF(_1 > 15 && _2 < 20) fun;
I don't think so. I am pretty sure that
_1 < 3.3 and _1 < 4.4
have the same _type_ (but they have different "double" _values_ encoded in the run-time structure when constructed).
Yes, thanks for correcting me. This makes one still want to use the BOOST_TYPEOF_ALLOCATE macro in this case.
I'd rather want to see: BOOST_AUTO(fun, _1 > 15 && _2 < 20); That would be very nifty for Spirit parsers: BOOST_AUTO(my_rule, int_p >> *(',' >> int_p)); I would love to incorporate this stuff into Spirit !!! 1) It would simplify grammars a lot. 2) It would give a significant performance boost 3) It would reduce the generated code size by as much as 80%. See http://tinyurl.com/2wuqr and http://tinyurl.com/2wuqr for reference. Spirit would definitely benifit from Arkadiy's typeof. I'd like to offer this challenge to Arkadiy. If you can easily retrofit Spirit with a generic typeof/auto facility, I would love to make it an integral part of the library. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net