[#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 `<bslstl_stringref.h>` Create an empty string reference. [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..._]# Create a string ref referencing the specified `bsl::basic_string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0a.adoc[StringRefImp](xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE>] const& str); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0a.adoc[_» more..._]# Create a string ref referencing the specified `std::pmr::basic_string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-01.adoc[StringRefImp](std::pmr::basic_string<CHAR_TYPE> const& str); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-01.adoc[_» more..._]# Create a string ref referencing the specified `std::basic_string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-09c.adoc[StringRefImp](std::basic_string<CHAR_TYPE> const& str); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-09c.adoc[_» more..._]# Create a string reference to external character data. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-049.adoc[StringRefImp](bsl::basic_string_view<CHAR_TYPE> const& str); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-049.adoc[_» more..._]# Create a string reference to a null‐terminated C string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0df.adoc[StringRefImp](CHAR_TYPE const* data); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0df.adoc[_» more..._]# Create a string reference to an iterator range. [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_iterator] begin, xref:BloombergLP/bslstl/StringRefImp-0c/const_iterator.adoc[const_iterator] end); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-04b.adoc[_» more..._]# Create a string reference to external character data. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-08.adoc[StringRefImp]( CHAR_TYPE const* data, xref:BloombergLP/bslstl/StringRefImp-0c/size_type.adoc[size_type] length); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-08.adoc[_» more..._]# Create a string reference to external character data. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INT_TYPE> xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0d7.adoc[StringRefImp]( CHAR_TYPE const* data, INT_TYPE length) requires bsl::is_integral<INT_TYPE>::value; ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0d7.adoc[_» more..._]# Create a string reference to a substring. [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_type] startIndex, xref:BloombergLP/bslstl/StringRefImp-0c/size_type.adoc[size_type] numCharacters); ---- [.small]#xref:BloombergLP/bslstl/StringRefImp-0c/2constructor-0d5.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *str* | string whose contents are referenced | *data* | null‐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]#