Skip to content

sg::swap_child

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

Synopsis

Declared in <SageIII/sageInterface/sageGeneric.h>

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

Template Parameters

Name

Description

SageNode

the parent node type

SageChild

the child node type

Parameters

Name

Description

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)

Created with MrDocs