[#BloombergLP-balxml-Formatter_PrettyImplUtil-addComment] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balxml.adoc[balxml]::xref:BloombergLP/balxml/Formatter_PrettyImplUtil.adoc[Formatter_PrettyImplUtil]::addComment :relfileprefix: ../../../ :mrdocs: Write the specified `comment` into the specified `stream`, with formatting depending on the specified `state`, and update the `state` accordingly. Return the `stream`. The optionally specified `forceNewline`, if true, forces to start a new line solely for the comment if it's not on a new line already. Otherwise, comments continue on current line. If an element‐opening tag is not completed with a `>`, `addComment` will add `>`. == Synopsis Declared in `<balxml_formatter_prettyimpl.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::ostream& addComment( std::ostream& stream, xref:BloombergLP/balxml/Formatter_PrettyImplUtil/State.adoc[State]* state, std::string_view const& comment, bool forceNewline = true); ---- == Description DEPRECATED: Use `addValidComment` instead. [.small]#Created with https://www.mrdocs.com[MrDocs]#