Boost logo

Boost :

Subject: Re: [boost] [proto] Phoenix3 port to proto complete
From: Joel de Guzman (joel_at_[hidden])
Date: 2010-07-27 20:16:28


On 7/28/10 4:06 AM, Thomas Heller wrote:
> 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).

You might want to re-post this with [bind] in the heading to solicit
a reply from Peter Dimov; (maybe CC him too). It's best to fully
understand the rationale behind the test.

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