Addition operators
Synopses
Declared in <bslstl_string.h>
Same as the primary operator+ with an rvalue lhs C‐string.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
CHAR_TYPE lhs,
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> const& rhs);
Same as the primary operator+ with a single CHAR_TYPE lhs and rvalue rhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
CHAR_TYPE lhs,
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&& rhs);
Same as the primary operator+ with a C‐string rhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> const& lhs,
CHAR_TYPE rhs);
Return the concatenation of the specified operands.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> const& lhs,
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> const& rhs);
Same as the primary operator+ overload with an rvalue lhs and lvalue rhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> const& lhs,
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&& rhs);
Return the concatenation of lhs and rhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> const& lhs,
CHAR_TYPE const* rhs);
Same as the primary operator+ with a single CHAR_TYPE rhs and rvalue lhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&& lhs,
CHAR_TYPE rhs);
Same as the primary operator+ overload with an rvalue lhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&& lhs,
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> const& rhs);
Same as the primary operator+ overload with an rvalue lhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&& lhs,
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&& rhs);
Same as the primary operator+ with a C‐string rhs and rvalue lhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&& lhs,
CHAR_TYPE const* rhs);
Same as the primary operator+ with a C‐string lhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
CHAR_TYPE const* lhs,
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> const& rhs);
Same as the primary operator+ with a C‐string lhs and rvalue rhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
CHAR_TYPE const* lhs,
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&& rhs);
Same as the primary operator+ with a string‐view‐like lhs and string rhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR,
class STRING_VIEW_LIKE_TYPE>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
STRING_VIEW_LIKE_TYPE const& lhs,
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> const& rhs);
Same as the primary operator+ with C‐string operands.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR,
class STRING_VIEW_LIKE_TYPE>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
STRING_VIEW_LIKE_TYPE const& lhs,
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&& rhs);
Same as the primary operator+ with a C‐string rhs and rvalue lhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR,
class STRING_VIEW_LIKE_TYPE>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR> const& lhs,
STRING_VIEW_LIKE_TYPE const& rhs);
Same as the primary operator+ for mixed bsl/`std` strings.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOC1,
class ALLOC2>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1>
operator+(
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1> const& lhs,
std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2> const& rhs);
Same as the primary operator+ for mixed std/`bsl` strings.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOC1,
class ALLOC2>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2>
operator+(
std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1> const& lhs,
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2> const& rhs);
Same as the primary operator+ for mixed std/`bsl` strings with an rvalue rhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOC1,
class ALLOC2>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2>
operator+(
std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1> const& lhs,
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2>&& rhs);
Same as the primary operator+ with an rvalue lhs and C‐string rhs.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOCATOR,
class STRING_VIEW_LIKE_TYPE>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>
operator+(
basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>&& lhs,
STRING_VIEW_LIKE_TYPE const& rhs);
Same as the primary operator+ for mixed bsl/`std` strings.
template<
class CHAR_TYPE,
class CHAR_TRAITS,
class ALLOC1,
class ALLOC2>
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1>
operator+(
bsl::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC1>&& lhs,
std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2> const& rhs);
Return Value
-
string equal to the concatenation of the operands
-
a string equal to
lhsfollowed byrhs
Parameters
Name |
Description |
lhs |
left‐hand operand |
rhs |
right‐hand operand |
Created with MrDocs