incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Farid_Zari...@epam.com>
Subject RE: std::getline() declaration header
Date Fri, 30 Mar 2007 16:49:58 GMT
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Tuesday, March 27, 2007 10:09 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: std::getline() declaration header
> 
> Farid Zaripov wrote:
> >> -----Original Message-----
> >> From: Martin Sebor [mailto:sebor@roguewave.com]
> >> Sent: Tuesday, March 27, 2007 8:53 PM
> >> To: stdcxx-dev@incubator.apache.org
> >> Subject: Re: std::getline() declaration header
> >>
> >>>   I've created the issue (the test case inside):
> >>> https://issues.apache.org/jira/browse/STDCXX-375
> >> I don't think the test case is valid. It expects 
> std::istream to be a 
> >> complete type but it only #includes <iosfwd> and not <istream>.

> >> <iosfwd> only declares the type (which need not make it complete). 
> >> Let me know if you disagree or if you have a test case 
> that detects 
> >> it w/o relying on istream being a complete type.
> > 
> >   Yes. That test case don't requires the istream as complete type.
> > This is compile only test (therefore that test do not have 
> the main() 
> > function).
> 
> Okay, I'll close the issue as invalid. Feel free to reopen it 
> if you produce a valid test case.

  I don't think that the test is invalid. It's a compile only test, but
it's valid :)
Here used only reference to the std::istream, so include <iosfwd> is
enough.

test.cpp:
---------------------------
#include <string>
#include <iosfwd>

void test (std::istream& is)
{
    std::string str;
    std::getline (is, str);
}
--------------------------- 

  I suppose that the <string> header file should include <istream>.

Farid.

Mime
View raw message