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 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.

Same as the primary operator+ overload with an rvalue lhs and lvalue 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 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.

Same as the primary operator+ overload with an rvalue lhs.

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);

Created with MrDocs