Boost logo

Boost :

Subject: Re: [boost] [Review] Phoenix review starts today, September 21st
From: Joel de Guzman (joel_at_[hidden])
Date: 2008-09-22 21:13:03


David Abrahams wrote:
> on Mon Sep 22 2008, "Peter Dimov" <pdimov-AT-pdimov.com> wrote:
>
>> Mathias Gaunard:
>>> Loïc Joly wrote:
>>>
>>>> - How does this library position itself wrt the upcomming C++0x > standard,
>>> with native support for lambdas, and standardized support for > function or
>>> bind? Is it more expressive?
>>>
>>> The C++0x standard only specifies monomorphic lambdas at the moment.
>>> So Phoenix is indeed more expressive, since all expressions are polymorphic.
>> Except phoenix::bind, which is monomorphic, for whatever reasons. :-)
>>
>> http://www.boost.org/doc/libs/1_36_0/libs/spirit/phoenix/doc/html/phoenix/composite.html#phoenix.composite.bind
>
> Hmm, that seems like it will needlessly restrict generic code.

Ah that one. I think that needs clarification. The note is wrong
and should be corrected. A bound function pointer or member function
pointer is only monorphic once bound (of course -- a single function
pointer or member function pointer is monomorphic). The same is true
with bind and lambda bind.

Phoenix bind, like bind and lambda bind is polymorphic at the call
site in the sense that it can bind to any function and function
pointer and function object (which can be polymorphic). One problem
I notice now with the bind documentation of phoenix is that it
lacks the function object binding part.

Noted for correction. Pardon the confusion.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk