/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/python/cpp20_variable_templates_runme.py
16 строк
455 B
William S Fulton
C++20: parse a requires-expression as a primary in expression position
10 май 2026, 19:37
10 май 2026, 19:37
c2de37f
Код
Авторство
О чём код?
import cpp20_variable_templates as m from swig_test_utils import swig_check # Variable template initialised from a requires-expression - wrapped as a # read only bool. int satisfies 't + t', NotAddable doesn't. swig_check(m.cvar.addable_int, True) swig_check(m.cvar.addable_notaddable, False) # Read only check: try: m.cvar.addable_int = False except AttributeError: pass else: raise RuntimeError("addable_int should be read only")