mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2026-08-27 00:26:02 -04:00
Add gdbpy_call_method overloads for gdbpy_ref<>
This adds an overload of gdbpy_call_method that accepts a gdbpy_ref<>. This is just a small convenience. Reviewed-By: Tom de Vries <tdevries@suse.de>
This commit is contained in:
parent
7c03e522d4
commit
c2d091ff5c
2 changed files with 14 additions and 5 deletions
|
|
@ -207,6 +207,15 @@ gdbpy_call_method (PyObject *o, const char *method,
|
|||
arg, args...));
|
||||
}
|
||||
|
||||
/* An overload that takes a gdbpy_ref<> rather than a raw 'PyObject *'. */
|
||||
|
||||
template<typename... Args>
|
||||
static inline gdbpy_ref<>
|
||||
gdbpy_call_method (const gdbpy_ref<> &o, const char *method, Args... args)
|
||||
{
|
||||
return gdbpy_call_method (o.get (), method, args...);
|
||||
}
|
||||
|
||||
/* Poison PyObject_CallMethod. The typesafe wrapper gdbpy_call_method should be
|
||||
used instead. */
|
||||
#undef PyObject_CallMethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue