diff options
author | Jason Merrill <jason@redhat.com> | 2009-07-31 22:26:42 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-07-31 22:26:42 -0400 |
commit | e7f1930f9411e6fcee99f832a5a16c74cd6740c6 (patch) | |
tree | 835681f433a68776c98b51aa17db749656db573d /libstdc++-v3/include/std/istream | |
parent | 4c65085391c06df2a7b1acb4767e63aee6763d2c (diff) | |
download | gcc-e7f1930f9411e6fcee99f832a5a16c74cd6740c6.zip gcc-e7f1930f9411e6fcee99f832a5a16c74cd6740c6.tar.gz gcc-e7f1930f9411e6fcee99f832a5a16c74cd6740c6.tar.bz2 |
call.c (convert_class_to_reference): Binding an lvalue to an rvalue reference is bad.
* call.c (convert_class_to_reference): Binding an lvalue to an
rvalue reference is bad. If the user-defined conversion is bad,
set bad_p before merging conversions.
(maybe_handle_ref_bind): Don't push down bad_p.
(reference_binding): Binding an lvalue to an rvalue reference is bad.
(convert_like_real): Give a helpful error about binding lvalue
to rvalue reference.
(reference_related_p): No longer static.
* typeck.c (build_typed_address): New.
(build_static_cast_1): Add static_cast from lvalue to &&.
* cp-tree.h: Adjust.
* include/bits/move.h (forward): Implement as in N2835.
(move): Implement as in N2831.
* include/std/istream (rvalue stream operator>>): New.
* include/std/ostream (rvalue stream operator<<): New.
Co-Authored-By: Douglas Gregor <doug.gregor@gmail.com>
From-SVN: r150327
Diffstat (limited to 'libstdc++-v3/include/std/istream')
-rw-r--r-- | libstdc++-v3/include/std/istream | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream index 1979a51..f20b896 100644 --- a/libstdc++-v3/include/std/istream +++ b/libstdc++-v3/include/std/istream @@ -827,6 +827,27 @@ _GLIBCXX_BEGIN_NAMESPACE(std) basic_istream<_CharT, _Traits>& ws(basic_istream<_CharT, _Traits>& __is); +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + // [27.7.1.6] Rvalue stream extraction + /** + * @brief Generic extractor for rvalue stream + * @param is An input stream. + * @param x A reference to the extraction target. + * @return is + * + * This is just a forwarding function to allow extraction from + * rvalue streams since they won't bind to the extractor functions + * that take an lvalue reference. + */ + template<typename _CharT, typename _Traits, typename _Tp> + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) + { + __is >> __x; + return __is; + } +#endif // __GXX_EXPERIMENTAL_CXX0X__ + _GLIBCXX_END_NAMESPACE #ifndef _GLIBCXX_EXPORT_TEMPLATE |