21 Strings library [strings]

21.4 Class template basic_string [basic.string]

21.4.8 basic_string non-member functions [string.nonmembers]

21.4.8.1 operator+ [string::op+]

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs);

Returns: basic_string<charT,traits,Allocator>(lhs).append(rhs)

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(basic_string<charT,traits,Allocator>&& lhs, const basic_string<charT,traits,Allocator>& rhs);

Returns: std::move(lhs.append(rhs))

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(const basic_string<charT,traits,Allocator>& lhs, basic_string<charT,traits,Allocator>&& rhs);

Returns: std::move(rhs.insert(0, lhs))

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(basic_string<charT,traits,Allocator>&& lhs, basic_string<charT,traits,Allocator>&& rhs);

Returns: std::move(lhs.append(rhs))Note: Or equivalently std::move(rhs.insert(0, lhs))  — end note ]

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs);

Returns: basic_string<charT,traits,Allocator>(lhs) + rhs.

Remarks: Uses traits::length().

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(const charT* lhs, basic_string<charT,traits,Allocator>&& rhs);

Returns: std::move(rhs.insert(0, lhs)).

Remarks: Uses traits::length().

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(charT lhs, const basic_string<charT,traits,Allocator>& rhs);

Returns: basic_string<charT,traits,Allocator>(1,lhs) + rhs.

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(charT lhs, basic_string<charT,traits,Allocator>&& rhs);

Returns: std::move(rhs.insert(0, 1, lhs)).

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(const basic_string<charT,traits,Allocator>& lhs, const charT* rhs);

Returns: lhs + basic_string<charT,traits,Allocator>(rhs).

Remarks: Uses traits::length().

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(basic_string<charT,traits,Allocator>&& lhs, const charT* rhs);

Returns: std::move(lhs.append(rhs)).

Remarks: Uses traits::length().

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(const basic_string<charT,traits,Allocator>& lhs, charT rhs);

Returns: lhs + basic_string<charT,traits,Allocator>(1,rhs).

template<class charT, class traits, class Allocator> basic_string<charT,traits,Allocator> operator+(basic_string<charT,traits,Allocator>&& lhs, charT rhs);

Returns: std::move(lhs.append(1, rhs)).