operator<<(std::basic_string_view) (3) - Linux Manuals
operator<<(std::basic_string_view): operator<<(std::basic_string_view)
Command to display operator<<(std::basic_string_view)
manual in Linux: $ man 3 operator<<(std::basic_string_view)
NAME
operator<<(std::basic_string_view) - operator<<(std::basic_string_view)
Synopsis
Defined in header <string_view>
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& (since C++17)
operator<<(std::basic_ostream<CharT, Traits>& os,
std::basic_string_view <CharT, Traits> v);
Behaves as a FormattedOutputFunction. After constructing and checking the sentry object, determines the output format padding as follows:
a) If v.size() is not less than os.width(), uses the range [v.begin(), v.end()) as-is
b) Otherwise, if (os.flags() & ios_base::adjustfield) == ios_base::left, places os.width()-v.size() copies of the os.fill() character after the character sequence
c) Otherwise, places os.width()-v.size() copies of the os.fill() character before the character sequence
Then stores each character from the resulting sequence (the contents of v plus padding) to the output stream os as if by calling os.rdbuf()->sputn(seq, n), where n=std::max(os.width(), str.size())
Finally, calls os.width(0) to cancel the effects of std::setw, if any.
Exceptions
May throw std::ios_base::failure if an exception is thrown during output.
Parameters
os - a character output stream
v - the view to be inserted
Return value
os
See also
performs stream input and output on strings
operator<< (function template)
operator>>
Pages related to operator<<(std::basic_string_view)
- operator<<(std::basic_ostream) (3) - operator<<(std::basic_ostream)
- operator<<(std::experimental::basic_string_view) (3) - operator<<(std::experimental::basic_string_view)
- operator<<(std::sub_match) (3) - operator<<(std::sub_match)
- operator<<(std::thread::id) (3) - operator<<(std::thread::id)
- operator<<,>>(std::basic_string) (3) - operator<<,>>(std::basic_string)
- operator<<,>>(std::bernoulli_distribution) (3) - operator<<,>>(std::bernoulli_distribution)
- operator<<,>>(std::binomial_distribution) (3) - operator<<,>>(std::binomial_distribution)
- operator<<,>>(std::bitset) (3) - operator<<,>>(std::bitset)
- operator<<,>>(std::cauchy_distribution) (3) - operator<<,>>(std::cauchy_distribution)
- operator<<,>>(std::chi_squared_distribution) (3) - operator<<,>>(std::chi_squared_distribution)
- operator<<,>>(std::complex) (3) - operator<<,>>(std::complex)
- operator<<,>>(std::discard_block_engine) (3) - operator<<,>>(std::discard_block_engine)
- operator<<,>>(std::discrete_distribution) (3) - operator<<,>>(std::discrete_distribution)
- operator<<,>>(std::experimental::filesystem::path) (3) - operator<<,>>(std::experimental::filesystem::path)