/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/cpp14_generic_lambda.i
18 строк
614 B
William S Fulton
C++14/20: parse auto parameters in functions and lambdas
13 май 2026, 01:04
13 май 2026, 01:04
0d88926
Код
Авторство
О чём код?
%module cpp14_generic_lambda // C++14 generic lambdas - lambdas with one or more 'auto' parameters. Each auto parameter introduces an // invented type template parameter at the C++ level. Lambdas are not directly wrapped, this test shows // one way to make them available via a manually written C++ function wrapper. %warnfilter(SWIGWARN_CPP11_LAMBDA); %inline %{ // Single auto parameter. auto twice = [](auto x) { return x + x; }; // Two auto parameters. auto add = [](auto a, auto b) { return a + b; }; int run_twice(int x) { return twice(x); } int run_add(int a, int b) { return add(a, b); } %}