This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch, libstdc++/64584, libstdc++/64585] Clear basic_regex after imbue and make assign exception tolerant
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Tim Shen <timshen at google dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 18 Jan 2015 00:24:26 +0000
- Subject: Re: [Patch, libstdc++/64584, libstdc++/64585] Clear basic_regex after imbue and make assign exception tolerant
- Authentication-results: sourceware.org; auth=none
- References: <CAG4ZjNmMbv4c-bix8VZV8CrudrZZOgMas3cKPhLwoiTnPOMUCA at mail dot gmail dot com> <20150116121217 dot GA3360 at redhat dot com> <CAG4ZjNndkWfK_zOkO5BK66jEQ+BQS+rGQ9nDGTzrQBZfLeZNJw at mail dot gmail dot com> <CAG4ZjNnkipPA1HaAJADdVHe_C2wFaAksxu5W5KF94oEXgwQPFg at mail dot gmail dot com>
On 17/01/15 16:08 -0800, Tim Shen wrote:
On Sat, Jan 17, 2015 at 4:06 PM, Tim Shen <timshen@google.com> wrote:
I'm not 100% sure of that, but isn't moving a pointer the same as copying?
You can't move a pointer, you can only copy it.
Rmember all std::move does is cast something to an rvalue reference,
whether that actually leads to a move depends on what happens to the
object afterwards.
Initializing a pointer from another pointer just copies the value and
has no way of doing anything different whether the source is an rvalue
or an lvalue.
I mean time cost here. By the way, is the rhs pointer still valid or
in an unspecified state?
It won't be changed at all.