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:
ThePhD 2017-08-24 17:12:13 -04:00
parent d98155cd22
commit 2b2a6d2ab1
2 changed files with 4 additions and 1 deletions

View File

@ -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;

View File

@ -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;