[#miniscript-Node-ToString-028]
= xref:miniscript.adoc[miniscript]::xref:miniscript/Node.adoc[Node]::ToString
:relfileprefix: ../../
:mrdocs:

Produces the textual (policy&hyphen;language) representation of this Miniscript&period;

== Synopses

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

Produces the textual (policy&hyphen;language) representation of this Miniscript&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename CTx&gt;
std::optional&lt;std::string&gt;
xref:miniscript/Node/ToString-02a.adoc[ToString](CTx const& ctx) const;
----

[.small]#xref:miniscript/Node/ToString-02a.adoc[_» more&period;&period;&period;_]#

Produces the textual (policy&hyphen;language) representation of this Miniscript&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename CTx&gt;
std::optional&lt;std::string&gt;
xref:miniscript/Node/ToString-0b.adoc[ToString](
    CTx const& ctx,
    bool& has&lowbar;priv&lowbar;key) const;
----

[.small]#xref:miniscript/Node/ToString-0b.adoc[_» more&period;&period;&period;_]#

== Return Value

The string form, or std&colon;&colon;nullopt if a key cannot be represented&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Context providing key&hyphen;to&hyphen;string conversions&period;
| *has&lowbar;priv&lowbar;key*
| Set to true if any key resolved to a private key&period;
|===


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