[Bug libstdc++/94051] New: #include <iosfwd> & <string_view> is not enough for operator<<
joerg.richter@pdv-fs.de
gcc-bugzilla@gcc.gnu.org
Thu Mar 5 14:37:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94051
Bug ID: 94051
Summary: #include <iosfwd> & <string_view> is not enough for
operator<<
Product: gcc
Version: 8.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: joerg.richter@pdv-fs.de
Target Milestone: ---
#include <iosfwd>
#include <string_view>
std::ostream& func( std::ostream& os, std::string_view v )
{
return os << v;
}
This code results in a compile error:
'__ostream_insert' was not declared in this scope
It would be nice if this two includes would be enough to stream a string_view.
This works already for <string>.
Adding the small <bits/ostream_insert.h> header to <string_view> fixes the
problem.
More information about the Gcc-bugs
mailing list