Instantiation of C++11 variadic function templates
Complete support for C++11 variadic function templates. Support was previously limited to just one template parameter. Now zero or more template parameters are supported in the %template instantiation.
This commit is contained in:
parent
cdc08c9325
commit
2fc0edc4fd
5 changed files with 132 additions and 55 deletions
|
|
@ -0,0 +1,20 @@
|
|||
from cpp11_variadic_function_templates import *
|
||||
|
||||
ec = EmplaceContainer()
|
||||
ec.emplace(A())
|
||||
ec.emplace(A(), B())
|
||||
ec.emplace(A(), B(), C())
|
||||
ec.emplace(A(), B(), C(), D())
|
||||
|
||||
def check(expected, got):
|
||||
if expected != got:
|
||||
raise RuntimeError("failed: {} != {}".format(expected, got))
|
||||
|
||||
a = A()
|
||||
b = B()
|
||||
c = C()
|
||||
check(variadicmix1(), 20)
|
||||
check(variadicmix1(a), 20)
|
||||
check(variadicmix1(a, b), 10)
|
||||
check(variadicmix1(a, b, c), 20)
|
||||
check(variadicmix1(11, 22), 10)
|
||||
Loading…
Add table
Add a link
Reference in a new issue