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: [email protected]
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.