This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Bug in libstdc++ documentation
- From: Joe Buck <Joe dot Buck at synopsys dot COM>
- To: Chris Frey <cdfrey at foursquare dot net>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Mon, 10 Oct 2005 11:42:47 -0700
- Subject: Re: Bug in libstdc++ documentation
- References: <20051010092101.GA4426@netdirect.ca>
On Mon, Oct 10, 2005 at 05:21:01AM -0400, Chris Frey wrote:
> Hi,
>
> Quick bug report. The sample code for #include <iosfwd> located here:
>
> http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#10
>
> is incorrect. std::ifstream is used in the example to declare a full
> type, instead of a reference or pointer, and that doesn't compile with
> just <iosfwd>.
Probably the simplest fix would be to make the input_file member of
MyClass a reference, so the example becomes
#include <iosfwd>
class MyClass
{
....
std::ifstream& input_file;
};
extern std::ostream& operator<< (std::ostream&, MyClass&);