luabind
luabind copied to clipboard
Failing unit test: "out_value" vs. "pure_out_value"
As reported here: https://github.com/Oberon00/luabind/pull/29#issuecomment-134530745
@fhoefling there is at least one failing test concerning "out_value" vs. "pure_out_value", see commit https://github.com/Oberon00/luabind/commit/a1199b51bc1b6af5cf7e6a5cfba021c4cacb1a78
[OT: I was baffled at first because your link to the commit (automatically created by github) points to https://github.com/Oberon00/luabind/commit/a1199b51bc1b6af5cf7e6a5cfba021c4cacb1a78 and I thought "Where is this commit gone?" but it seems that git locates the commits by ID for any fork, no matter which fork you use in the URL, e.g. try https://github.com/luabind/luabind/commit/4274bb6f347d23f3bc8f2dee106b0d01f97.... ]
Seems complicated to fix as some converters are stateful and rely on e.g. match
being called before apply
(see for example https://github.com/Oberon00/luabind/blob/master/luabind/detail/policy.hpp#L217). However, to instantiate the appropriate converter, the out value converter would need to know which ‒ but it learns that only once match
is called at runtime! Honestly, I think this design is broken. But a workaround to fix this withouth greater modifications, would be to introduce a type erased wrapper for the converter (exchanging the T
s per void*
) and instantiating that in match
.
see https://github.com/rpavlik/luabind/commit/42b8219486a0f7b3509493e3a1435e1289d2f7da
Honestly, I would love to see your two forks merged, Isn't it kindof counter productive to manually cherry pick commits from each others fork?
Have you read my above comment about stateful converters? The current test is insufficient to catch this error. Try using a class-type as out-value parameter and I bet you get an access violation.
And regarding mine and @rpavlik's fork being merged: I think neither of us is against that idea, but it would be a lot of work and at least I do not want to spend too much time on luabind anymore.