ValueTree parent("Parent"); ValueTree child("Child"); parent.addChild(child, -1, nullptr);
ValueTree parent("Parent"); ValueTree child1("Child1"); ValueTree child2("Child2"); parent.addChild(child1, -1, nullptr); parent.addChild(child2, -1, &undoManager);In this example, two child nodes "Child1" and "Child2" are created. The addChild function is used to add both child nodes to the parent node "Parent". However, the second addChild function call also takes an undo manager object as an argument, allowing for undo/redo functionality. The cpp ValueTree library is a part of the JUCE C++ framework.