Re: [PATCH][RFC] Make iterating over hash-map elide copying/destructing

2018-07-11 Thread Pedro Alves
On 07/11/2018 12:24 PM, Trevor Saunders wrote: > However if we went that route we should prevent use of the > assignment operator by declaring one explicitly and making it private but > then not implementing it, so it at least fails to link and with some > macros you can actually tell the compiler

Re: [PATCH][RFC] Make iterating over hash-map elide copying/destructing

2018-07-11 Thread Trevor Saunders
On Tue, Jul 10, 2018 at 11:46:54AM +0200, Richard Biener wrote: > On Tue, 10 Jul 2018, Trevor Saunders wrote: > > > On Tue, Jul 10, 2018 at 10:43:20AM +0200, Richard Biener wrote: > > > > > > The following makes the hash-map iterator dereference return a pair > > Value&> rather than a copy of Val

Re: [PATCH][RFC] Make iterating over hash-map elide copying/destructing

2018-07-10 Thread Richard Biener
On Tue, 10 Jul 2018, Richard Biener wrote: > On Tue, 10 Jul 2018, Trevor Saunders wrote: > > > On Tue, Jul 10, 2018 at 10:43:20AM +0200, Richard Biener wrote: > > > > > > The following makes the hash-map iterator dereference return a pair > > Value&> rather than a copy of Value. This matches th

Re: [PATCH][RFC] Make iterating over hash-map elide copying/destructing

2018-07-10 Thread Richard Biener
On Tue, 10 Jul 2018, Trevor Saunders wrote: > On Tue, Jul 10, 2018 at 10:43:20AM +0200, Richard Biener wrote: > > > > The following makes the hash-map iterator dereference return a pair > Value&> rather than a copy of Value. This matches the hash-table iterator > > behavior and avoids issues wit

Re: [PATCH][RFC] Make iterating over hash-map elide copying/destructing

2018-07-10 Thread Trevor Saunders
On Tue, Jul 10, 2018 at 10:43:20AM +0200, Richard Biener wrote: > > The following makes the hash-map iterator dereference return a pair Value&> rather than a copy of Value. This matches the hash-table iterator > behavior and avoids issues with > > hash_map > Eventually somebodies probably goi

[PATCH][RFC] Make iterating over hash-map elide copying/destructing

2018-07-10 Thread Richard Biener
The following makes the hash-map iterator dereference return a pair rather than a copy of Value. This matches the hash-table iterator behavior and avoids issues with hash_map > where iterating over the hash-table will call the auto_vec destructor when dereferencing the iterator. I note that