mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
One day, Lua 5.1 will be phased out of existence and everyone will have the latest and greatest...
... One day.
This commit is contained in:
parent
d98155cd22
commit
2b2a6d2ab1
|
@ -77,13 +77,14 @@ int main(int, char*[]) {
|
|||
sol::meta_function::pairs, my_pairs
|
||||
);
|
||||
|
||||
#ifdef SOL_LUA_VERSION < 502
|
||||
lua.safe_script(R"(
|
||||
local mt = my_thing.new()
|
||||
for k, v in pairs(mt) do
|
||||
print(k, v)
|
||||
end
|
||||
)");
|
||||
|
||||
#endif // Does not work on Lua 5.1
|
||||
std::cout << std::endl;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -72,12 +72,14 @@ int main(int, char*[]) {
|
|||
sol::meta_function::pairs, &my_pairs
|
||||
);
|
||||
|
||||
#ifdef SOL_LUA_VERSION < 502
|
||||
lua.safe_script(R"(
|
||||
local mt = my_thing.new()
|
||||
for k, v in pairs(mt) do
|
||||
print(k, v)
|
||||
end
|
||||
)");
|
||||
#endif // Does not work on Lua 5.1 and below
|
||||
|
||||
std::cout << std::endl;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user