Template Function sg::swap_child

Template Function sg::swap_child#

Function Documentation#

template<class SageNode, class SageChild>
void sg::swap_child(SageNode &lhs, SageNode &rhs, SageChild *(SageNode::* getter)() const, void (SageNode::* setter)(SageChild*))#

swaps children (of equal kind) between two ancestor nodes of the same type

Template Parameters:
  • SageNode – the parent node type

  • SageChild – the child node type

Parameters:
  • lhs – one parent node

  • rhs – another parent node

  • getter – the getter function to extract the child from lhs (and rhs)

  • setter – the setter function to store the child in lhs (and rhs)