mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
24 lines
498 B
C++
24 lines
498 B
C++
|
#include <sol/sol.hpp>
|
||
|
|
||
|
inline namespace sol2_regression_test_1149 {
|
||
|
struct Test {
|
||
|
static Test* staticCreate() {
|
||
|
return new Test();
|
||
|
}
|
||
|
Test* create() {
|
||
|
return new Test();
|
||
|
}
|
||
|
};
|
||
|
} // namespace sol2_regression_test_1149
|
||
|
|
||
|
unsigned int regression_1149() {
|
||
|
sol::state lua = {};
|
||
|
auto T = lua.new_usertype<Test>("Test");
|
||
|
// compile ok.
|
||
|
T.set_function("create", &Test::create);
|
||
|
// compile error.
|
||
|
T.set_function("staticCreate", &Test::staticCreate);
|
||
|
|
||
|
return 0;
|
||
|
}
|