fusion::result_of::invoke_function_object and references

I have another question regarding compilation failures with fusion. If
this has been discussed before, can someone please point me to the right
location. If not...
Is there some reason the application of result_of::invoke_function_object
fails to compile for sequence argument references?
ie: result_of::invoke_function_object

AMDG Mike Tegtmeyer wrote:
I have another question regarding compilation failures with fusion. If this has been discussed before, can someone please point me to the right location. If not...
Is there some reason the application of result_of::invoke_function_object fails to compile for sequence argument references?
ie: result_of::invoke_function_object
::type Digging a little, it seems that the failure is due to the size<> operator doesn't work with reference types (or is expecting the reference to be stripped prior to this point). I understand that to avoid unnecessary copies, tiers are typically used but in the case where chains of invoke_function_object would like to be strung together where there is an assignment or construction from the actual return value to a variable declared as the type obtained from result_of (in a fold for example), it seems that the vector copy is unavoidable (at least in my reading) unless the argument vector is a const reference.
Is this an oversight or am I missing something?
Basically I am trying to string together N function objects in the sequence where the ith object gets called with the result of the i-1th object (where each has a different argument list) using fold and I am running into extraneous copies of the return value. I can post a full example if needed.
Thanks in advance, Mike
error message: /opt/local/include/boost/fusion/sequence/intrinsic/size.hpp:28: error: const boost::fusion::vector
& is not a class, struct, or union type
Strip the references of when you call result_of::invoke_function_object. You don't need to actually pass anything by value. This is just the return type calculation. In Christ, Steven Watanabe

I appreciate the reply, On Jun 26, 2009, at 6:02 PM, Steven Watanabe wrote:
Strip the references of when you call result_of::invoke_function_object. You don't need to actually pass anything by value. This is just the return type calculation.
I guess my problem is that references don't seem to be preserved when
setting up a function object pipeline via fold. Seems there should be
a single copy construct from the return of the function object
invocation to the new state object but a trace results in a couple of
extra state objet copies per invoke_function_object invocation.
Is there something I'm missing?
Again, thanks in advance,
Mike
Attached is something to compile to illustrate my problem-apologies
for the length.
#include
participants (2)
-
Mike Tegtmeyer
-
Steven Watanabe