[#miniscript-ForEachNode]
= xref:miniscript.adoc[miniscript]::ForEachNode
:relfileprefix: ../
:mrdocs:

Unordered traversal of a miniscript node tree&period;

== Synopsis

Declared in `&lt;script&sol;miniscript&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename Key,
    std::invocable&lt;Node&lt;Key&gt; const&&gt; Fn&gt;
void
ForEachNode(
    xref:miniscript/Node.adoc[Node&lt;Key&gt;] const& root,
    Fn&& fn);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *root*
| The root node from which traversal starts&period;
| *fn*
| Callable invoked once for each node in the tree&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
