Re: std::vector move assign patch

2017-04-25 Thread Marc Glisse
On Tue, 25 Apr 2017, Jonathan Wakely wrote: That's only 5 more memory operations. If I tweak vector swapping to avoid calling swap on each member (which drops type-based aliasing information, that was the topic of PR64601) I didn't really understand the discussion in the PR. I find that's tru

Re: std::vector move assign patch

2017-04-25 Thread Jonathan Wakely
On 25/04/17 18:12 +0200, Marc Glisse wrote: On Tue, 25 Apr 2017, Jonathan Wakely wrote: On 25/04/17 17:23 +0200, Marc Glisse wrote: On Tue, 25 Apr 2017, Jonathan Wakely wrote: On 24/04/17 22:10 +0200, Marc Glisse wrote: It seems that this patch had 2 consequences that may or may not have be

Re: std::vector move assign patch

2017-04-25 Thread Marc Glisse
On Tue, 25 Apr 2017, Jonathan Wakely wrote: On 25/04/17 17:23 +0200, Marc Glisse wrote: On Tue, 25 Apr 2017, Jonathan Wakely wrote: On 24/04/17 22:10 +0200, Marc Glisse wrote: It seems that this patch had 2 consequences that may or may not have been planned. Consider this example (from PR646

Re: std::vector move assign patch

2017-04-25 Thread Jonathan Wakely
On 25/04/17 17:23 +0200, Marc Glisse wrote: On Tue, 25 Apr 2017, Jonathan Wakely wrote: On 24/04/17 22:10 +0200, Marc Glisse wrote: It seems that this patch had 2 consequences that may or may not have been planned. Consider this example (from PR64601) #include typedef std::vector V; void f(

Re: std::vector move assign patch

2017-04-25 Thread Marc Glisse
On Tue, 25 Apr 2017, Jonathan Wakely wrote: On 24/04/17 22:10 +0200, Marc Glisse wrote: It seems that this patch had 2 consequences that may or may not have been planned. Consider this example (from PR64601) #include typedef std::vector V; void f(V&v,V&w){ V(std::move(w)).swap(v); } void g(V

Re: std::vector move assign patch

2017-04-25 Thread Jonathan Wakely
On 25/04/17 13:52 +0100, Jonathan Wakely wrote: On 24/04/17 22:10 +0200, Marc Glisse wrote: It seems that this patch had 2 consequences that may or may not have been planned. Consider this example (from PR64601) #include typedef std::vector V; void f(V&v,V&w){ V(std::move(w)).swap(v); } void

Re: std::vector move assign patch

2017-04-25 Thread Jonathan Wakely
On 24/04/17 22:10 +0200, Marc Glisse wrote: It seems that this patch had 2 consequences that may or may not have been planned. Consider this example (from PR64601) #include typedef std::vector V; void f(V&v,V&w){ V(std::move(w)).swap(v); } void g(V&v,V&w){ v=std::move(w); } 1) We generate sho

Re: std::vector move assign patch

2017-04-24 Thread Marc Glisse
On Thu, 9 Jan 2014, Jonathan Wakely wrote: On 9 January 2014 12:22, H.J. Lu wrote: On Fri, Dec 27, 2013 at 10:27 AM, François Dumont wrote: Hi Here is a patch to fix an issue in normal mode during the move assignment. The destination vector allocator instance is moved too during the assi

Re: std::vector move assign patch

2014-01-09 Thread Jonathan Wakely
On 9 January 2014 12:22, H.J. Lu wrote: > On Fri, Dec 27, 2013 at 10:27 AM, François Dumont > wrote: >> Hi >> >> Here is a patch to fix an issue in normal mode during the move >> assignment. The destination vector allocator instance is moved too during >> the assignment which is wrong. >> >>

Re: std::vector move assign patch

2014-01-09 Thread H.J. Lu
On Fri, Dec 27, 2013 at 10:27 AM, François Dumont wrote: > Hi > > Here is a patch to fix an issue in normal mode during the move > assignment. The destination vector allocator instance is moved too during > the assignment which is wrong. > > As I discover this problem while working on issu

Re: std::vector move assign patch

2014-01-08 Thread Jonathan Wakely
On 27 December 2013 18:27, François Dumont wrote: > Hi > > Here is a patch to fix an issue in normal mode during the move > assignment. The destination vector allocator instance is moved too during > the assignment which is wrong. Thanks for your patience, the normal-mode fix is definitely cor

Re: std::vector move assign patch

2014-01-07 Thread Jonathan Wakely
On 7 January 2014 21:12, François Dumont wrote: > I saw on another thread that 4.9 release was getting closer. Applying this > patch sounds like a good idear for this release. > > Any feedback ? Yes, it's coming :-) I imagine most of us have been on holiday and are just getting back to speed, and

Re: std::vector move assign patch

2014-01-07 Thread François Dumont
I saw on another thread that 4.9 release was getting closer. Applying this patch sounds like a good idear for this release. Any feedback ? On 12/27/2013 07:27 PM, François Dumont wrote: Hi Here is a patch to fix an issue in normal mode during the move assignment. The destination vector

std::vector move assign patch

2013-12-27 Thread François Dumont
Hi Here is a patch to fix an issue in normal mode during the move assignment. The destination vector allocator instance is moved too during the assignment which is wrong. As I discover this problem while working on issues with management of safe iterators during move operations this