[#bsl-operator_plus-0d0] = xref:bsl.adoc[bsl]::operator+ :relfileprefix: ../ :mrdocs: Addition operators == Synopses Declared in `<bslstl_string.h>` Same as the primary `operator+` with an rvalue `lhs` C‐string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-03.adoc[operator+]( CHAR_TYPE lhs, xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] const& rhs); ---- [.small]#xref:bsl/operator_plus-03.adoc[_» more..._]# Same as the primary `operator+` with a single `CHAR_TYPE` `lhs` and rvalue `rhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-0b.adoc[operator+]( CHAR_TYPE lhs, xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]&& rhs); ---- [.small]#xref:bsl/operator_plus-0b.adoc[_» more..._]# Same as the primary `operator+` with a C‐string `rhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-01b.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] const& lhs, CHAR_TYPE rhs); ---- [.small]#xref:bsl/operator_plus-01b.adoc[_» more..._]# Return the concatenation of strings constructed from the specified `lhs` and `rhs` arguments, i.e., `basic_string(lhs).append(rhs)`. The allocator of the returned string is determined per the rules in P1165 (https://www.open‐std.org/jtc1/sc22/wg21/docs/papers/2018/p1165r1.html). Note that overloads that accept rvalue references are implemented for C++11 and later only. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-06c.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] const& lhs, xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] const& rhs); ---- [.small]#xref:bsl/operator_plus-06c.adoc[_» more..._]# Same as the primary `operator+` overload with an rvalue `lhs` and lvalue `rhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-09.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] const& lhs, xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]&& rhs); ---- [.small]#xref:bsl/operator_plus-09.adoc[_» more..._]# Same as the primary `operator+` with a C‐string `rhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-06e.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] const& lhs, CHAR_TYPE const* rhs); ---- [.small]#xref:bsl/operator_plus-06e.adoc[_» more..._]# Same as the primary `operator+` with a single `CHAR_TYPE` `rhs` and rvalue `lhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-02.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]&& lhs, CHAR_TYPE rhs); ---- [.small]#xref:bsl/operator_plus-02.adoc[_» more..._]# Same as the primary `operator+` overload with an rvalue `lhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-0cd.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]&& lhs, xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] const& rhs); ---- [.small]#xref:bsl/operator_plus-0cd.adoc[_» more..._]# Same as the primary `operator+` overload with an rvalue `lhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-04.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]&& lhs, xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]&& rhs); ---- [.small]#xref:bsl/operator_plus-04.adoc[_» more..._]# Same as the primary `operator+` with a C‐string `rhs` and rvalue `lhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-064.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]&& lhs, CHAR_TYPE const* rhs); ---- [.small]#xref:bsl/operator_plus-064.adoc[_» more..._]# Same as the primary `operator+` with a C‐string `lhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-014.adoc[operator+]( CHAR_TYPE const* lhs, xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] const& rhs); ---- [.small]#xref:bsl/operator_plus-014.adoc[_» more..._]# Same as the primary `operator+` with a C‐string `lhs` and rvalue `rhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-0d8.adoc[operator+]( CHAR_TYPE const* lhs, xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]&& rhs); ---- [.small]#xref:bsl/operator_plus-0d8.adoc[_» more..._]# Same as the primary `operator+` with a string‐view‐like `lhs` and string `rhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR, class STRING_VIEW_LIKE_TYPE> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-062.adoc[operator+]( STRING_VIEW_LIKE_TYPE const& lhs, xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] const& rhs); ---- [.small]#xref:bsl/operator_plus-062.adoc[_» more..._]# Same as the primary `operator+` with C‐string operands. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR, class STRING_VIEW_LIKE_TYPE> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-0c9.adoc[operator+]( STRING_VIEW_LIKE_TYPE const& lhs, xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]&& rhs); ---- [.small]#xref:bsl/operator_plus-0c9.adoc[_» more..._]# Same as the primary `operator+` with a C‐string `rhs` and rvalue `lhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR, class STRING_VIEW_LIKE_TYPE> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-0e1.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] const& lhs, STRING_VIEW_LIKE_TYPE const& rhs); ---- [.small]#xref:bsl/operator_plus-0e1.adoc[_» more..._]# Same as the primary `operator+` for mixed `bsl`/`std` strings. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOC1, class ALLOC2> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1>] xref:bsl/operator_plus-0dd.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1>] const& lhs, std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2> const& rhs); ---- [.small]#xref:bsl/operator_plus-0dd.adoc[_» more..._]# Same as the primary `operator+` for mixed `std`/`bsl` strings. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOC1, class ALLOC2> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2>] xref:bsl/operator_plus-0e3.adoc[operator+]( std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1> const& lhs, xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2>] const& rhs); ---- [.small]#xref:bsl/operator_plus-0e3.adoc[_» more..._]# Same as the primary `operator+` for mixed `std`/`bsl` strings with an rvalue `rhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOC1, class ALLOC2> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2>] xref:bsl/operator_plus-08.adoc[operator+]( std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1> const& lhs, xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2>]&& rhs); ---- [.small]#xref:bsl/operator_plus-08.adoc[_» more..._]# Same as the primary `operator+` with an rvalue `lhs` and C‐string `rhs`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR, class STRING_VIEW_LIKE_TYPE> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>] xref:bsl/operator_plus-07.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>]&& lhs, STRING_VIEW_LIKE_TYPE const& rhs); ---- [.small]#xref:bsl/operator_plus-07.adoc[_» more..._]# Same as the primary `operator+` for mixed `bsl`/`std` strings. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS, class ALLOC1, class ALLOC2> xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1>] xref:bsl/operator_plus-0a.adoc[operator+]( xref:bsl/basic_string-0faf.adoc[bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1>]&& lhs, std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2> const& rhs); ---- [.small]#xref:bsl/operator_plus-0a.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#