std::operator+(std::basic_string)
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(1) | |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(2) | |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(3) | |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(4) | |
template<class CharT, class Traits, class Alloc> basic_string<CharT,Traits,Alloc> |
(5) | |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(6) | (C++11 起) |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(7) | (C++11 起) |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(8) | (C++11 起) |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(9) | (C++11 起) |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(10) | (C++11 起) |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(11) | (C++11 起) |
template< class CharT, class Traits, class Alloc > basic_string<CharT,Traits,Alloc> |
(12) | (C++11 起) |
lhs
随后的字符rhs
.lhs
followed by the characters from rhs
.目录 |
[编辑] 参数
lhs | - | 字符串,字符,或指向一个空结尾的数组中的第一个字符
原文: string, character, or pointer to the first character in a null-terminated array |
rhs | - | 字符串,字符,或指向一个空结尾的数组中的第一个字符
原文: string, character, or pointer to the first character in a null-terminated array |
[编辑] 返回值
1) basic_string<CharT,Traits,Alloc>(lhs).append(rhs)
2) basic_string<CharT,Traits,Alloc>(lhs) + rhs
3) basic_string<CharT,Traits,Alloc>(1,lhs) + rhs
4) lhs + basic_string<CharT,Traits,Alloc>(rhs)
5) lhs + basic_string<CharT,Traits,Alloc>(1,rhs)
6) std::move(lhs.append(rhs))
7) std::move(rhs.insert(0, lhs))
8) std::move(lhs.append(rhs)) or std::move(rhs.insert(0, lhs))
9) std::move(rhs.insert(0, lhs))
10) std::move(rhs.insert(0, 1, lhs))
11) std::move(lhs.append(rhs))
12) std::move(lhs.append(1, rhs))
[编辑] 示例
#include <iostream> #include <string> int main() { std::string s1 = "Hello"; std::string s2 = "world"; std::cout << s1 + ' ' + s2 + "!\n"; }
输出:
Hello world!
[编辑] 另请参阅
追加到结束的字符 (公共成员函数) | |
追加到结束的字符 (公共成员函数) | |
插入字符 (公共成员函数) |