
On Tue, Feb 9, 2010 at 2:12 AM, Rutger ter Borg <rutger@terborg.net> wrote:
OvermindDL1 wrote:
That boost::function is originally created at the time of the register call (and is also contained in the struct that is returned from the register call to skip a map lookup if you use it directly), but it contains another fusion apply struct template that specializes on the original passed in function, and dserializes each chunk in turn, then fusion invokes the actual function with the deserialized generated fusion vector of the arguments.
Thanks, much more clear already. How does the boost::function object know what kind of fusion::vector to deserialize? Do you keep some kind of extra mapping for argument-type to function-type?
Yes, the boost function just holds a pointer to a templated struct that is refined based on the function itself, that is how that struct know how to do everything, kind of like a subclass with a single virtual function.