[#bsl-operator_plus-0d0]
= xref:bsl.adoc[bsl]::operator&plus;
:relfileprefix: ../
:mrdocs:

Addition operators

== Synopses

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

Same as the primary `operator&plus;` with an rvalue `lhs` C&hyphen;string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-03.adoc[operator&plus;](
    CHAR&lowbar;TYPE lhs,
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_plus-03.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` with a single `CHAR&lowbar;TYPE` `lhs` and rvalue `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-0b.adoc[operator&plus;](
    CHAR&lowbar;TYPE lhs,
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]&& rhs);
----

[.small]#xref:bsl/operator_plus-0b.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` with a C&hyphen;string `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-01b.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& lhs,
    CHAR&lowbar;TYPE rhs);
----

[.small]#xref:bsl/operator_plus-01b.adoc[_» more&period;&period;&period;_]#

Return the concatenation of the specified operands&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-06c.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& lhs,
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_plus-06c.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` overload with an rvalue `lhs` and lvalue `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-09.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& lhs,
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]&& rhs);
----

[.small]#xref:bsl/operator_plus-09.adoc[_» more&period;&period;&period;_]#

Return the concatenation of `lhs` and `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-06e.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& lhs,
    CHAR&lowbar;TYPE const* rhs);
----

[.small]#xref:bsl/operator_plus-06e.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` with a single `CHAR&lowbar;TYPE` `rhs` and rvalue `lhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-02.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]&& lhs,
    CHAR&lowbar;TYPE rhs);
----

[.small]#xref:bsl/operator_plus-02.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` overload with an rvalue `lhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-0cd.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]&& lhs,
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_plus-0cd.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` overload with an rvalue `lhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-04.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]&& lhs,
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]&& rhs);
----

[.small]#xref:bsl/operator_plus-04.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` with a C&hyphen;string `rhs` and rvalue `lhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-064.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]&& lhs,
    CHAR&lowbar;TYPE const* rhs);
----

[.small]#xref:bsl/operator_plus-064.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` with a C&hyphen;string `lhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-014.adoc[operator&plus;](
    CHAR&lowbar;TYPE const* lhs,
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_plus-014.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` with a C&hyphen;string `lhs` and rvalue `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-0d8.adoc[operator&plus;](
    CHAR&lowbar;TYPE const* lhs,
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]&& rhs);
----

[.small]#xref:bsl/operator_plus-0d8.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` with a string&hyphen;view&hyphen;like `lhs` and string `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR,
    class STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-062.adoc[operator&plus;](
    STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE const& lhs,
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& rhs);
----

[.small]#xref:bsl/operator_plus-062.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` with C&hyphen;string operands&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR,
    class STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-0c9.adoc[operator&plus;](
    STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE const& lhs,
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]&& rhs);
----

[.small]#xref:bsl/operator_plus-0c9.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` with a C&hyphen;string `rhs` and rvalue `lhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR,
    class STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-0e1.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;] const& lhs,
    STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE const& rhs);
----

[.small]#xref:bsl/operator_plus-0e1.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` for mixed `bsl`&sol;`std` strings&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOC1,
    class ALLOC2&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC1&gt;]
xref:bsl/operator_plus-0dd.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC1&gt;] const& lhs,
    std::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC2&gt; const& rhs);
----

[.small]#xref:bsl/operator_plus-0dd.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` for mixed `std`&sol;`bsl` strings&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOC1,
    class ALLOC2&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC2&gt;]
xref:bsl/operator_plus-0e3.adoc[operator&plus;](
    std::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC1&gt; const& lhs,
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC2&gt;] const& rhs);
----

[.small]#xref:bsl/operator_plus-0e3.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` for mixed `std`&sol;`bsl` strings with an rvalue `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOC1,
    class ALLOC2&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC2&gt;]
xref:bsl/operator_plus-08.adoc[operator&plus;](
    std::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC1&gt; const& lhs,
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC2&gt;]&& rhs);
----

[.small]#xref:bsl/operator_plus-08.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` with an rvalue `lhs` and C&hyphen;string `rhs`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOCATOR,
    class STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]
xref:bsl/operator_plus-07.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOCATOR&gt;]&& lhs,
    STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE const& rhs);
----

[.small]#xref:bsl/operator_plus-07.adoc[_» more&period;&period;&period;_]#

Same as the primary `operator&plus;` for mixed `bsl`&sol;`std` strings&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE,
    class CHAR&lowbar;TRAITS,
    class ALLOC1,
    class ALLOC2&gt;
xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC1&gt;]
xref:bsl/operator_plus-0a.adoc[operator&plus;](
    xref:bsl/basic_string-0faf.adoc[bsl::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC1&gt;]&& lhs,
    std::basic&lowbar;string&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS, ALLOC2&gt; const& rhs);
----

[.small]#xref:bsl/operator_plus-0a.adoc[_» more&period;&period;&period;_]#

== Return Value

* string equal to the concatenation of the operands
* a string equal to `lhs` followed by `rhs`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *lhs*
| left&hyphen;hand operand
| *rhs*
| right&hyphen;hand operand
|===


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