
David Abrahams <dave@boost-consulting.com> writes:
Brian McNamara <lorgon@cc.gatech.edu> writes:
[snip]
I am trying to find the 'hard' cases where the compiler might not be able to easily make the temporary have the right 'lifetime', and thus require an extra copy.
I don't see any problem here. There's no problem getting the rvalue out of source(), or sink(source()) would fail. Furthermore, no compiler I've ever seen will actually make the allowed temporary in that case.
FWIW, I think at least one version of the IBM Visual Age compiler disallows bindings to a noncopyable rvalue, possibly because it actually wants to create a temporary. All compilers *should* issue a diagnostic anyway, whether they actually need the temporary or not. See e.g. "Problem with struct wrapstrstream": http://lists.boost.org/MailArchives/boost/msg36290.php BTW, has anyone else noticed that all of Google's links to the boost mail archive are wrong at the moment? It looks like the messages have all been renumbered at some stage, invalidating all previous URLs (e.g. Google thinks the above message is at http://lists.boost.org/MailArchives/boost/msg09814.php). I got the up-to-date link from AltaVista. -- Raoul Gough. export LESS='-X'