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
|
sol::meta_function::pairs, my_pairs
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#ifdef SOL_LUA_VERSION < 502
|
||||||
lua.safe_script(R"(
|
lua.safe_script(R"(
|
||||||
local mt = my_thing.new()
|
local mt = my_thing.new()
|
||||||
for k, v in pairs(mt) do
|
for k, v in pairs(mt) do
|
||||||
print(k, v)
|
print(k, v)
|
||||||
end
|
end
|
||||||
)");
|
)");
|
||||||
|
#endif // Does not work on Lua 5.1
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -72,12 +72,14 @@ int main(int, char*[]) {
|
||||||
sol::meta_function::pairs, &my_pairs
|
sol::meta_function::pairs, &my_pairs
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#ifdef SOL_LUA_VERSION < 502
|
||||||
lua.safe_script(R"(
|
lua.safe_script(R"(
|
||||||
local mt = my_thing.new()
|
local mt = my_thing.new()
|
||||||
for k, v in pairs(mt) do
|
for k, v in pairs(mt) do
|
||||||
print(k, v)
|
print(k, v)
|
||||||
end
|
end
|
||||||
)");
|
)");
|
||||||
|
#endif // Does not work on Lua 5.1 and below
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user