Remove make_cleanup_value_free
[deliverable/binutils-gdb.git] / gdb / value.h
index 6dee80af339b1abd1e7a65fe35172d64ec41f892..bc97ec0728f34aa969320a13f7def0d28894f748 100644 (file)
@@ -1018,6 +1018,21 @@ extern void value_incref (struct value *val);
 
 extern void value_free (struct value *val);
 
+/* A free policy class to interface std::unique_ptr with
+   value_free.  */
+
+struct value_deleter
+{
+  void operator() (struct value *value) const
+  {
+    value_free (value);
+  }
+};
+
+/* A unique pointer to a struct value.  */
+
+typedef std::unique_ptr<struct value, value_deleter> gdb_value_up;
+
 extern void free_all_values (void);
 
 extern void free_value_chain (struct value *v);
This page took 0.02356 seconds and 4 git commands to generate.