SyTen

◆ visit_top() [5/6]

template<typename T >
template<typename Func >
std::result_of< Func(Valueconst &)>::type syten::BinaryTree::Tree< T >::visit_top ( Func &&  f,
typename std::result_of< Func(Value &)>::type  initial,
IterFirst const  dir = IterFirst::Left 
)
inline

Visits each node, starting at the root node.

Parameters
ffunction to call on each node value
initialinitial value of the accumulator
dirleft or right branch first?
Returns
the accumulated value from the root node and each branch

References syten::BinaryTree::Tree< T >::r, and syten::BinaryTree::Tree< T >::visit_top_rec().

+ Here is the call graph for this function: