[Phoenix] Monomorphic functors don't expose result_type

I thought bind was supposed to generate monomorphic functors when used with function pointers, pointers to members, or monomorphic functors. Yet the functors it generates don't expose result_type, but only the result template. Moreover, I would expect functors to stay monomorphic when generating lambdas. If foo and bar are monomorphic (and thus expose result_type), foo < bar should be monomorphic too.

Mathias Gaunard wrote:
I thought bind was supposed to generate monomorphic functors when used with function pointers, pointers to members, or monomorphic functors. Yet the functors it generates don't expose result_type, but only the result template.
If that's the case, then it's a bug.
Moreover, I would expect functors to stay monomorphic when generating lambdas. If foo and bar are monomorphic (and thus expose result_type), foo < bar should be monomorphic too.
I agree. Thanks for pointing this out. If you can provide test cases, I can add them to the V2 tests. I'm not sure that V3, with it's use of result_of, has problems with this, but it's good to have the test anyway. There may be far deeper consequences for this. To be honest, I never paid too much attention on monomorphic lambdas. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

Joel de Guzman wrote:
Mathias Gaunard wrote:
I thought bind was supposed to generate monomorphic functors when used with function pointers, pointers to members, or monomorphic functors. Yet the functors it generates don't expose result_type, but only the result template.
If that's the case, then it's a bug.
A simple example: int foo() { return 0; } struct bar { typedef int result_type; int operator()() { return 0; } }; Neither bind(foo) nor bind(bar()) seem to have a result_type.
participants (2)
-
Joel de Guzman
-
Mathias Gaunard