06-19-2017, 03:50 AM
This is what choked the compiler:
I was hoping that this template would work with the old code that has no CoordCheckFn specification. So far the only solution I was able to find is to split the template definition into two - the old code without the CoordCheckFn, and a new one with CoordCheckFn that has no default. Seems to be working now, but I'm not too happy about the code duplication.
/** Template for the bindings for the DoWithXYZAt(X, Y, Z) functions that need to check their coords. */ template < class SELF, class ITEM, bool (SELF::*DoWithFn)(int, int, int, cItemCallback<ITEM> &), bool (SELF::*CoordCheckFn)(int, int, int) const = nullptr > static int DoWithXYZ(lua_State * tolua_S) { ...
I was hoping that this template would work with the old code that has no CoordCheckFn specification. So far the only solution I was able to find is to split the template definition into two - the old code without the CoordCheckFn, and a new one with CoordCheckFn that has no default. Seems to be working now, but I'm not too happy about the code duplication.