Use forward_scope_exit for scoped_finish_thread_state
[deliverable/binutils-gdb.git] / gdb / common / gdb_ref_ptr.h
index 57d1db96e6cd6b50789e82ebae52825dc635a84c..65afe9529843ffd4d2ff73da67dfa052013d57ec 100644 (file)
@@ -1,6 +1,6 @@
 /* Reference-counted smart pointer class
 
-   Copyright (C) 2016-2018 Free Software Foundation, Inc.
+   Copyright (C) 2016-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -149,6 +149,13 @@ class ref_ptr
     return m_obj;
   }
 
+  /* Acquire a new reference and return a ref_ptr that owns it.  */
+  static ref_ptr<T, Policy> new_reference (T *obj)
+  {
+    Policy::incref (obj);
+    return ref_ptr<T, Policy> (obj);
+  }
+
  private:
 
   T *m_obj;
This page took 0.027735 seconds and 4 git commands to generate.