swig/Examples/test-suite/python/template_template_parameters_runme.py
William S Fulton 05b93b1f06 Improved template template parameters support.
Previously, specifying more than one simple template template parameter
resulted in a parse error. Now multiple template template parameters are
working including instantiation with %template. Example:

  template <template<template<class> class, class> class Op, template<class> class X, class Y>
    class C { ... };

Closes #624
Closes #1021
2022-12-02 19:16:02 +00:00

33 lines
848 B
Python

from template_template_parameters import *
# Test part 1
listBool = ListFastBool()
listBool.item = True
x_boolean = listBool.allotype
if listBool.item != True:
raise RuntimeError("Failed")
listDouble = ListDefaultDouble()
listDouble.item = 10.2
x_double = listDouble.allotype
if listDouble.item != 10.2:
raise RuntimeError("Failed")
# Test part 2
floatTestStruct = FloatTestStruct()
floatContainer2 = floatTestStruct.x
floatContainer2.x = 8.1
intTestStruct = IntTestStruct()
intContainer1 = intTestStruct.x
intContainer1.x = 91
if intContainer1.x != 91:
raise RuntimeError("Failed")
if intTestStruct.x.x != 91:
raise RuntimeError("Failed")
intTestStructReturned = TestStructContainer1Method(intTestStruct)
if intTestStructReturned.x.x != 101:
raise RuntimeError("Failed")
# Test part 3
mfi99 = MyFootInt99()
mfi99 += mfi99 # __iadd__