[#BloombergLP-bdldfp-DecimalUtil_CStringUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdldfp.adoc[bdldfp]::DecimalUtil&lowbar;CStringUtil
:relfileprefix: ../../
:mrdocs:

This component&hyphen;private utility `struct` provides a namespace for the `flatten` overload set intended to be used in concert with an overload set consisting of a function template with a deduced argument and an non&hyphen;template overload accepting a `const char &ast;`&period; The actual implementation of the functionality would be in the `const char &ast;` overload whereas the purpose of the function template is to invoke the &grave;const char &ast;&grave; overload with a null&hyphen;terminated string&period;

== Synopsis

Declared in `&lt;bdldfp&lowbar;decimalutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct DecimalUtil&lowbar;CStringUtil;
----

== Description

The function template achieves null&hyphen;termination by recursively calling the function and supplying it with the result of `flatten` invoked on the deduced argument&period; This `flatten` invocation will call `c&lowbar;str()` on various supported `string` types, will produce a temporary `bsl&colon;&colon;string` for possibly non&hyphen;null&hyphen;terminated `bslstl&colon;&colon;StringRef`, and will result in a `BSLMF&lowbar;ASSERT` for any unsupported type&period; Calling the function with the temporary `bsl&colon;&colon;string` produced from `bslstl&colon;&colon;StringRef` will result in a second invocation of `flatten`, this time producing `const char &ast;`, and finally calling the function with a null&hyphen;terminated string&period;

Note that the `bslstl&colon;&colon;StringRef` overload for `flatten` is provided for backwards compatibility&period; Without it, the `bsl&colon;&colon;string` and `std&colon;&colon;string` overloads would be ambiguous&period; In new code, it is preferable to not provide `bslstl&colon;&colon;StringRef` overload in a similar facility and require the clients to explicitly state the string type in their code, making a potential allocation obvious&period; The `bsl&colon;&colon;string&lowbar;view` overload is not provided for the same reason&period;

== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdldfp/DecimalUtil_CStringUtil/flatten-02.adoc[`flatten`] 
| `flatten` overloads
|===



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