27 std::function<
void(std::ostream&,T&)> to_stream) :
33 void print (std::ostream& out, T root)
54 size_t nchildren = children.size();
57 std::string branch = prefix +
" `" +
59 for (
size_t i = 0; i < nchildren - 1; ++i)
72 #endif // DBG_TREE_HPP std::function< void(std::ostream &, T &)> to_stream_
Behavior of displaying a node in the structure.
Definition: tree.hpp:45
const char vert_branch
Definition: tree.hpp:16
void print_helper(std::ostream &out, T root, std::string prefix)
Definition: tree.hpp:48
void print(std::ostream &out, T root)
Definition: tree.hpp:33
size_t branch_length_
Horizontal length of the branch, by default the branch looks like `–.
Definition: tree.hpp:39
std::function< std::vector< T >T &)> traverser_
Behavior of traversing through a structure.
Definition: tree.hpp:42
PrettyTree(std::function< std::vector< T >(T &)> traverser, std::function< void(std::ostream &, T &)> to_stream)
Definition: tree.hpp:26