Boost logo

Boost :

Subject: Re: [boost] [proto] Phoenix3 port to proto complete
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2010-07-27 16:06:38


Eric Niebler wrote:

> On 7/27/2010 6:31 AM, Thomas Heller wrote:
>> Status update:
>> 21 out of 25 Boost.Bind tests pass!
>>
>> 4 of the unit tests do not pass, because boost::result_of does not
>> support functions with stdcall or fastcall attributes.
>
> IIRC, in Bind stdcall/fastcall support is conditional. I bet if you
> patched result_of to have such conditional support for those calling
> conventions and submitted a patch, it would be gladly accepted.
>
>> 2 other tests (bind_cv_test.cpp and bind_stateful_test.cpp) are currently
>> implemented a little hacky, because as of this writing phoenix::bind only
>> cares for const operator() overloads.
>
> Right, you can overload operator() on const, so it matters for return
> type computation.

The functors in question didn't have a polymorphic return type.
It was just a matter, that the non-const operator() overload was never
called. Code in question looks something like this:

struct X
{
   typedef void result_type;

   void operator()() {} // (1)
   void operator()() const {} // (2)
};

template <typename F>
void g(F f)
{
   F const& h(f);

   h(); // <-- (2) was expected to be called here, but (1) gets called
}

int main
{
   using boost::phoenix::bind;

   X x;
   bind(x); // binding x in some non-const context
}

I think phoenix behaves correctly here. But I am not really sure, because it
must have been some justification to end up us a Boost.Bind testcase.

>> 2 other tests (bind_eq_test.cpp and bind_function_test.cpp) are only
>> working because i left out some stuff which isn't implemented yet.
>> bind_placeholder_test.cpp is not working as expected, because phoenix3
>> has no support for real costum placeholders (as in the purpose of this
>> test).
>
> I hope phoenix supports this eventually.

Yes, I will work on that. Might need some help with the binary visitation of
a proto AST. I will shout then ;)

> Thanks!


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