Farid Zaripov wrote:
-----Original Message-----
From: Martin Sebor [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 27, 2007 10:09 PM
To: [email protected]
Subject: Re: std::getline() declaration header

Farid Zaripov wrote:
-----Original Message-----
From: Martin Sebor [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 27, 2007 8:53 PM
To: [email protected]
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.

You're right. I agree the test case is valid. I don't know what
I was thinking. Let me reopen it.


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>.

I'd hate to have to do that. Including all of <istream> would
pull in most of locale as well and make <string> one gigantic
header. I think a declaration of the function template (but
not necessarily a definition) should do it.

Martin

Reply via email to