POD stands for Plain Old Data - that is, a struct (or class) with no members except data members. Wikipedia goes into a bit more detail and defines a POD in C++ as "A Plain Old Data Structure in C++ is an aggregate class that contains only PODS as members, has no user-defined destructor, no user-defined copy assignment operator, and no nonstatic members of pointer-to-member type." So if I'd create external functions, instead of member functions, everything is going to work?
Nevermind, vectors and strings aren't PODs. .. Damnit.
Why update a feature from the C language that is patently unsafe? There are much safer ways to accomplish the same thing. Variadic functions should be no more than a curiosity for intermediate C++ programmers. You only need to learn what it does so you know how to refactor it.
Pass a container to the CNode constructor instead.
I agree that instead one should pass a sequential container of arguments to the CNode constructor, however... ah. That's why they didn't update variadic functions. It's a waste of effort.
I'm willing to bet there's a more efficient algorithm for this that I don't know about, but here's one way to do it. Keep track of the size of the tree. To check for loops, attempt to iterate over all the nodes, counting the nodes you've visited. If the iteration count exceeds the size of the tree, you've got a loop somewhere.