I don't see many posts on or examples of using methods. (I have submitted a patch for registering member functions with arguments - see the patch section of this forum.)
My question is how to register a class method and/or a free method (say with at least one argument). The two are probably equivalent.
Using QxClass<T>::fct_1 does not work and will create an error complaining a mismatch of argument types (involving T*). I have tried in vain invoking insert_fct (after making it public in QxClass) with qx::function::bind_fct_1 (it compiles but core-dumps), as follows:
template <> void register_class(QxClass<TestTable> & t)
{
...
t.insertFct(qx::function::bind_fct_1<TestTable, int, int>(
&TestTable::square), "square");
}
Does QxOrm support static/class methods natively? If so, how do I register a static method (or a free method for that matter)? If not, what code changes will make it work, and how soon will it make it to the next release? Even just some ideas will be great. I have a work-around by defining a new functor class to wrap around the static method and registering that functor class instead, but it could get tedious if you have a lot of static methods to register.