{ Snapshot<Node> shot( *this); //A snapshot of a subtree. printf("Node1 = %lf, Node2 = %lf\n", shot[ *child_node1].m_x, shot[ *child_node2].m_y); //looking up parts of the snapshot. }//Example for transactional writing.
this->iterate_commit([=](Transaction<Node> &tr) { const Snapshot<Node> &shot(tr); //for read-only access. tr[ *this].m_z = shot[ *child_node1].m_x + shot[ *child_node2].m_y; tr[ *this].m_z = shot[ *this].m_z + 1; });//Example for linking.
this->iterate_commit_if([=](Transaction<Node> &tr) { //adding a new link to child_node1. if( !this->insert(tr, child_node1, true)) return false; tr[ *child_node1].m_x = 1; return true; });//Other examples: transaction_test.cpp,transaction_dynamic_node_test.cpp,transaction_negotiation_test.cpp