A very performance relevant shortcoming of the existing implementation of partial function closure is that the result is always wrapped into a std::function, which typically causes a heap allocation when more than a single pre-bound argument must be stored — which is annoying, since the underlying Binder provides inline storage and thus could be handled directly as a value object. However, returning the Binder directly is also problematic, since this object is outfitted with several overloaded function call operators, which defeats most techniques to detect a function signature. Notably, relevant down-stream metaprogramming code, like the tuple-closure used in the `NodeBuilder` would break when being confronted directly with a binder object. An investigation shows that there is no direct remedy, short of wrapping the binder into another functor. This can be accomplished with a helper template, that generates a wrapper; however, this wrapper builder must be supplied with explicit type information regarding the function arguments (precisely because this type signature can not be picked up from the Binder object itself)
9.7 MiB
9.7 MiB
| The file is too large to be shown. |