[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.1 Common 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.1 Common 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)
