In the above code, the struct() in anonymousStruct() can be call one time, the second time will cause stack overflow.
If I change "name1" to "name", the first time when call struct() in annonymousStruct() will cause stack overflow.
When I try to solve the problem, I find even there is no recursion, the stack overflow may happen.
Here I try to combine name1 and name2 into one name.
I use the template as recursion, it will cause stack overflow. I'm sure there will not be an endless recursive call. The template looks as following:
In the above code, the struct() in anonymousStruct() can be call one time, the second time will cause stack overflow. If I change "name1" to "name", the first time when call struct() in annonymousStruct() will cause stack overflow.
When I try to solve the problem, I find even there is no recursion, the stack overflow may happen. Here I try to combine name1 and name2 into one name.
combineoutput2 and combineoutput is just like the situation when I mentioned above.
If I really want to combine names in template, How can I solve the problem?