This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/9] Change decode_compound_collector to use std::vector


On 2018-08-17 14:04, Keith Seitz wrote:
@@ -3514,12 +3511,10 @@ public:
       htab_delete (m_unique_syms);
   }

-  /* Releases ownership of the collected symbols and returns them.  */
-  VEC (symbolp) *release_symbols ()
+  /* Return all symbols collected.  */
+  std::vector<symbol *> release_symbols ()
   {
-    VEC (symbolp) *res = m_symbols;
-    m_symbols = NULL;
-    return res;
+    return std::move (m_symbols);

I've always read that it was bad to use std::move on a return value:

https://diego.assencio.com/?index=f57f25fd5a187c70fc7f34fcf5374773

though in this case it seems like the right thing to do.

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]