Files
2025-10-25 03:02:53 +03:00

37 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[string.view.io]
# 27 Strings library [[strings]](./#strings)
## 27.3 String view classes [[string.view]](string.view#io)
### 27.3.5 Inserters and extractors [string.view.io]
[🔗](#lib:operator%3c%3c,basic_string_view)
`template<class charT, class traits>
basic_ostream<charT, traits>&
operator<<(basic_ostream<charT, traits>& os, basic_string_view<charT, traits> str);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/strings.tex#L1656)
*Effects*: Behaves as a formatted output
function ([[ostream.formatted.reqmts]](ostream.formatted.reqmts "31.7.6.3.1Common requirements")) of os[.](#1.sentence-1)
Forms a character sequenceseq, initially consisting of the elements defined by the range
[str.begin(), str.end())[.](#1.sentence-2)
Determines padding for seq as described in [[ostream.formatted.reqmts]](ostream.formatted.reqmts "31.7.6.3.1Common requirements")[.](#1.sentence-3)
Then inserts seq as if by callingos.rdbuf()->sputn(seq, n), where n is the larger
of os.width() and str.size();
then calls os.width(0)[.](#1.sentence-4)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/strings.tex#L1668)
*Returns*: os[.](#2.sentence-1)