/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/lua/li_std_pair_runme.lua
31 строка
895 B
Erez Geva
Remove Lua 5.0 and Lua 5.1 and Lua options
30 май 2026, 19:24
30 май 2026, 19:24
74ff929
Код
Авторство
О чём код?
require_to_globs("li_std_pair") intPair = makeIntPair(7, 6) assert(intPair.first==7 and intPair.second==6) intPairPtr = makeIntPairPtr(7, 6) assert(intPairPtr.first==7 and intPairPtr.second==6) intPairRef = makeIntPairRef(7, 6) assert(intPairRef.first == 7 and intPairRef.second == 6) intPairConstRef = makeIntPairConstRef(7, 6) assert(intPairConstRef.first == 7 and intPairConstRef.second == 6) -- call fns assert(product1(intPair) == 42) assert(product2(intPair) == 42) assert(product3(intPair) == 42) -- also use the pointer version assert(product1(intPairPtr) == 42) assert(product2(intPairPtr) == 42) assert(product3(intPairPtr) == 42) -- or the other types assert(product1(intPairRef) == 42) assert(product2(intPairRef) == 42) assert(product3(intPairRef) == 42) assert(product1(intPairConstRef) == 42) assert(product2(intPairConstRef) == 42) assert(product3(intPairConstRef) == 42)