/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/python/cpp11_alias_template_inheritance_runme.py
20 строк
936 B
William S Fulton
Add test coverage and docs for alias templates as a base class and using-declaration qualifier
20 июн 2026, 09:20
20 июн 2026, 09:20
c0754fb
Код
Авторство
О чём код?
from cpp11_alias_template_inheritance import * from swig_test_utils import swig_check # Member imported through the identity alias template base 'XIdentity<X>'. swig_check(DerivedX().m(), 11) # Inherited enum imported through the identity alias template base 'PaletteIdentity<Palette>', and the # alias used as a function parameter type. The enumerators wrap as attributes of the Palette proxy. swig_check(Palette.RED, 0) swig_check(Palette.GREEN, 1) swig_check(Palette.BLUE, 2) swig_check(palette_to_int(Palette.GREEN), 1) # Overload imported through the alias template base 'AdderAlias<int>' merges with the local overload. ac = AliasCalcInt() swig_check(ac.add(5), 105) # local single-arg overload swig_check(ac.add(2, 3), 5) # imported two-arg overload via using through the alias template # Inherited constructor reached through the identity alias template base 'BaseCIdentity<BaseC>'. swig_check(DerivedC(42).value, 42)