[#BloombergLP-bslstl-StringRefImp-0a-2constructor-03]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/StringRefImp-0a.adoc[StringRefImp&lt;wchar&lowbar;t&gt;]::StringRefImp
:relfileprefix: ../../../
:mrdocs:

Create a string&hyphen;reference object having a valid `std&colon;&colon;string` value, whose external representation begins at the specified `data` address and extends for the specified `length`&period; The external representation must remain valid as long as it is bound to this string reference&period; Passing 0 has the same effect as default construction&period; The behavior is undefined unless `0 &lt;&equals; length` and, if `0 &equals;&equals; data`, then `0 &equals;&equals; length`&period; Note that, like an `std&colon;&colon;string`, the `data` need not be null&hyphen;terminated and may contain embedded null characters&period; Note that the template and non&hyphen;template versions combine to allow various integral and enumeration types to be used for length while preventing `(char &ast;, 0)` initializer arguments from matching the two&hyphen;iterator constructor below&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;stringref&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INT&lowbar;TYPE&gt;
StringRefImp(
    wchar&lowbar;t const* data,
    INT&lowbar;TYPE length)
requires bsl&colon;&colon;is&lowbar;integral&lt;INT&lowbar;TYPE&gt;&colon;&colon;value;
----


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