You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I'm struggling to bind the centrify method. Adding after sol::constructors:
"centrify", &Rect2D<C>::centrify
error: no matching function for call to 'sol::state::new_usertype<Based::Rect2D >(const std::string&, sol::constructors< blah blah blah >, <unresolved overloaded function type>)'
Well, the next step solved the issue. Should have listened to the compiler, although at first glance this syntax looks incorrect to me:
"centrify", &Rect2D<C>::template centrify<C>
Quite interesting that if I move the UT outside of the lambda, then the expected syntax from the previous message works fine: &Rect2D<int>::centrify<int>
Consider a simple templated class that has several templated constructors and methods:
where
Size2D<T> = Point2D<T> = struct { T x, y }
.I'm trying to bind it to Lua. Let's sacrifice ability to have
U != T
in templates, and considerT = U = C
. Then, I can do the following:Ok, that works fine:
However, I'm struggling to bind the
centrify
method. Adding after sol::constructors:"centrify", &Rect2D<C>::centrify
error: no matching function for call to 'sol::state::new_usertype<Based::Rect2D >(const std::string&, sol::constructors< blah blah blah >, <unresolved overloaded function type>)'
Hm, maybe
error: no matching function for call to 'resolve<Based::Rect2D(const Based::Rect2D&)>(<unresolved overloaded function type>)
So, how should it be done correctly?
Thank you in advance.
The text was updated successfully, but these errors were encountered: