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
This is not so user-friendly API, because one should use sol::wrap<decltype(<expr>), <expr>> (or write macro to avoid copy-pasting).
I suggest replacing it with:
template <auto F>
struct wrap {
using type = decltype(F);
...
};
sol2 requires C++17, so there should be no concern about using auto in non-type template parameters
this is a breaking change, however upcoming v4.0.0 release is the right time to do it
if you don't want to break anything, you can simply add template <auto F> struct foobar with different name, but sol::wrap is a really good name for such a wrapper
P.S. you can also refactor sol::function_detail with auto F feature without breaking sol2 API:
Now
sol::wrap
is implemented as follows:sol2/include/sol/function_types_templated.hpp
Lines 132 to 139 in a7da2a8
This is not so user-friendly API, because one should use
sol::wrap<decltype(<expr>), <expr>>
(or write macro to avoid copy-pasting).I suggest replacing it with:
auto
in non-type template parameterstemplate <auto F> struct foobar
with different name, butsol::wrap
is a really good name for such a wrapperP.S. you can also refactor
sol::function_detail
withauto F
feature without breaking sol2 API:sol2/include/sol/function_types_templated.hpp
Lines 30 to 115 in a7da2a8
The text was updated successfully, but these errors were encountered: