Created on 2012-03-05.00:00:00 last changed 153 months ago
Proposed resolution:
This wording is relative to N3376.
Change the class template basic_istream synopsis, [istream], as indicated
namespace std {
template <class charT, class traits = char_traits<charT> >
class basic_istream : virtual public basic_ios<charT,traits> {
public:
[…]
// 27.7.2.3 Unformatted input:
[…]
basic_istream<charT,traits>& getline(char_type* s, streamsize n);
basic_istream<charT,traits>& getline(char_type* s, streamsize n,
char_type delim);
template<class Allocator>
basic_istream<charT,traits>& getline(basic_string<charT,traits,Allocator>& str);
template<class Allocator>
basic_istream<charT,traits>& getline(basic_string<charT,traits,Allocator>& str,
char_type delim);
[…]
};
}
Insert the following two new prototype descriptions after [istream.unformatted] paragraph 24:
basic_istream<charT,traits>& getline(char_type* s, streamsize n);-24- Returns: getline(s,n,widen('\n'))
template<class Allocator> basic_istream<charT,traits>& getline(basic_string<charT,traits,Allocator>& str);-??- Returns: std::getline(*this, str)
template<class Allocator> basic_istream<charT,traits>& getline(basic_string<charT,traits,Allocator>& str, char_type delim);-??- Returns: std::getline(*this, str, delim)
[ 2013-04-20, Bristol ]
Unanimous that this is a new feature request and not a issue.
Resolution: Tentatively NADI think the following code should be legal:
void f(std::istream& is)
{
std::string s;
is.getline(s); // Would be equivalent to std::getline(is, s)
}
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2013-05-20 16:39:06 | admin | set | messages: + msg6514 |
| 2013-05-20 16:39:06 | admin | set | status: new -> nad |
| 2012-03-06 00:07:17 | admin | set | messages: + msg6047 |
| 2012-03-05 00:00:00 | admin | create | |