On Thu, 2008-06-26 at 15:09 +0100, Sam Liddicott wrote:
We see that the last function (above) has the arguments the wrong way
around because I had removed the instance_pos.
But in fact it is only the entry method that needs to take into account
instance_pos when ordering it's declared arguments.
The inner "real" methods can be "normal" without any strange calling
conventions, and the entry dispatching method could "know" this.
And so I'm really suggesting that for virtual methods, instance_pos only
apply to the wrapper and not to the real functions at all.
It would then be illegal to specify instance_pos on override methods,
only on virtual methods.
It depends on the use case. For your example, it would certainly make
sense to only change the wrapper, however, in other cases, it might be
necessary to apply the attribute to both, the wrapper and the real
function, to be compatible with existing libraries.
For my own edification, can you think of a case where existing
libraries can get or give a reference to the real function (rather than
just the wrapper)?