This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Overload std::getline for rvalue streams
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 12 Aug 2014 16:38:28 +0100
- Subject: Re: [patch] Overload std::getline for rvalue streams
- Authentication-results: sourceware.org; auth=none
- References: <20140812152007 dot GS6927 at redhat dot com>
On 12/08/14 16:20 +0100, Jonathan Wakely wrote:
We're missing these overloads required by C++11.
Tested x86_64-linux, committed to trunk.
I missed an 'inline' on one of the new overloads, fixed by this patch,
which I'll commit once testing finishes.
commit 64240d493d1d72f78538d8bb06445d3ccb7a49b2
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Tue Aug 12 16:33:03 2014 +0100
* include/bits/basic_string.h (getline): Declare inline.
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 6a54d0c..93ceb6d 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -2816,7 +2816,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L
/// Read a line from an rvalue stream into a string.
template<typename _CharT, typename _Traits, typename _Alloc>
- basic_istream<_CharT, _Traits>&
+ inline basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is,
basic_string<_CharT, _Traits, _Alloc>& __str, _CharT __delim)
{ return std::getline(__is, __str, __delim); }