[#BloombergLP-bslstl-StringRefImp-0c-2constructor-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/StringRefImp-0c.adoc[StringRefImp]::StringRefImp
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

Create an empty string reference&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-094.adoc[StringRefImp]();
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-094.adoc[_» more&period;&period;&period;_]#

Create a string ref referencing the specified `bsl&colon;&colon;basic&lowbar;string`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0a.adoc[StringRefImp](xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE&gt;] const& str);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0a.adoc[_» more&period;&period;&period;_]#

Create a string ref referencing the specified `std&colon;&colon;pmr&colon;&colon;basic&lowbar;string`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-01.adoc[StringRefImp](std::pmr::basic&lowbar;string&lt;CHAR&lowbar;TYPE&gt; const& str);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-01.adoc[_» more&period;&period;&period;_]#

Create a string ref referencing the specified `std&colon;&colon;basic&lowbar;string`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-09c.adoc[StringRefImp](std::basic&lowbar;string&lt;CHAR&lowbar;TYPE&gt; const& str);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-09c.adoc[_» more&period;&period;&period;_]#

Create a string reference to external character data&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-049.adoc[StringRefImp](bsl::basic&lowbar;string&lowbar;view&lt;CHAR&lowbar;TYPE&gt; const& str);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-049.adoc[_» more&period;&period;&period;_]#

Create a string reference to a null&hyphen;terminated C string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0df.adoc[StringRefImp](CHAR&lowbar;TYPE const* data);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0df.adoc[_» more&period;&period;&period;_]#

Create a string reference to an iterator range&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-04b.adoc[StringRefImp](
    xref:BloombergLP/bslstl/StringRefImp-0c/const_iterator.adoc[const&lowbar;iterator] begin,
    xref:BloombergLP/bslstl/StringRefImp-0c/const_iterator.adoc[const&lowbar;iterator] end);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-04b.adoc[_» more&period;&period;&period;_]#

Create a string reference to external character data&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-08.adoc[StringRefImp](
    CHAR&lowbar;TYPE const* data,
    xref:BloombergLP/bslstl/StringRefImp-0c/size_type.adoc[size&lowbar;type] length);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-08.adoc[_» more&period;&period;&period;_]#

Create a string reference to external character data&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INT&lowbar;TYPE&gt;
xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0d7.adoc[StringRefImp](
    CHAR&lowbar;TYPE const* data,
    INT&lowbar;TYPE length)
requires bsl&colon;&colon;is&lowbar;integral&lt;INT&lowbar;TYPE&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0d7.adoc[_» more&period;&period;&period;_]#

Create a string reference to a substring&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0d5.adoc[StringRefImp](
    xref:BloombergLP/bslstl/StringRefImp-0c.adoc[StringRefImp] const& original,
    xref:BloombergLP/bslstl/StringRefImp-0c/size_type.adoc[size&lowbar;type] startIndex,
    xref:BloombergLP/bslstl/StringRefImp-0c/size_type.adoc[size&lowbar;type] numCharacters);
----

[.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0d5.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *str*
| string whose contents are referenced
| *data*
| null&hyphen;terminated character string to reference
| *begin*
| the start of the external representation
| *end*
| one past the end of the external representation
| *length*
| number of characters in the referenced sequence
| *original*
| string reference providing the external data
| *startIndex*
| starting index within `original`
| *numCharacters*
| maximum number of characters to reference
|===


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