bsl::operator+

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

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);
» more...

Return Value

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

Parameters

NameDescription
lhsleft-hand operand
rhsright-hand operand