You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@stdcxx.apache.org by "Farid Zaripov (JIRA)" <ji...@apache.org> on 2008/01/31 17:39:08 UTC

[jira] Issue Comment Edited: (STDCXX-375) std::getline() declared in , but should be declared in

    [ https://issues.apache.org/jira/browse/STDCXX-375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12564393#action_12564393 ] 

farid edited comment on STDCXX-375 at 1/31/08 8:37 AM:
---------------------------------------------------------------

The following example fails to compile on MSVC 7.1 and MSVC 8.0, but succeeds on icc 9.1, icc 10.0, gcc and comeau online.

{noformat}
class stream;   // line 1

class string
{
};

stream& getline (stream& is, string& str);

void foo (stream& is)
{
    string str;
    getline (is, str);   // line 12
}
{noformat}

  The build log:

{noformat}
test.cpp(12) : error C2027: use of undefined type 'stream'
        test.cpp(1) : see declaration of 'stream'
{noformat}

      was (Author: farid):
    The following example fails to compile on MSVC 7.1 and MSVC 8.0, but succeeds on icc 9.1, icc 10.0, gcc and comeau online.

-----------------------------------
class stream;   // line 1

class string
{
};

stream& getline (stream& is, string& str);

void foo (stream& is)
{
    string str;
    getline (is, str);   // line 12
}
-----------------------------------

test.cpp(12) : error C2027: use of undefined type 'stream'
        test.cpp(1) : see declaration of 'stream'

  
> std::getline() declared in <istream>, but should be declared in <string>
> ------------------------------------------------------------------------
>
>                 Key: STDCXX-375
>                 URL: https://issues.apache.org/jira/browse/STDCXX-375
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 21. Strings
>    Affects Versions: 4.1.3, 4.1.4, 4.2.0
>         Environment: All
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>             Fix For: 4.2.1
>
>   Original Estimate: 3h
>  Remaining Estimate: 3h
>
> The following code fails to compile with errors:
> test.cpp(7) : error C2039: 'getline' : is not a member of 'std'
> test.cpp(7) : error C3861: 'getline': identifier not found, even with argument-dependent lookup
> test.cpp:
> ---------------------------
> #include <string>
> #include <iosfwd>
> void test (std::istream& is)
> {
>     std::string str;
>     std::getline (is, str);
> }
> ---------------------------
> The addition information here: http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200703.mbox/%3c7BDB2168BEAEF14C98F1901FD2DE6438594C10@epmsa009.minsk.epam.com%3e

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.