/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/python/cpp11_inheriting_constructors_runme.py
20 строк
886 B
William S Fulton
Inherit constructors named through a typedef base
17 июн 2026, 03:47
17 июн 2026, 03:47
b78dba1
Код
Авторство
О чём код?
from cpp11_inheriting_constructors import * # Constructor inheritance via using declaration d = DerivedClass(10) if d.retrieveValue() != 10: raise RuntimeError("retrieveValue() failed"); # A protected member brought into the public interface through a typedef naming a base that has inheriting constructors if UseInheritCtorTypedef(42).protectedValue() != 42: raise RuntimeError("UseInheritCtorTypedef.protectedValue() failed"); # A protected base method brought into the public interface through a typedef naming a template-mixin # base whose constructors are inherited through the template parameter (issue #2951) if UseTemplateInheritCtor(42).protectedValue() != 42: raise RuntimeError("UseTemplateInheritCtor.protectedValue() failed"); # Member initialization at the site of the declaration s = SomeClass() if s.value != 5: raise RuntimeError("s.value failed");