diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/pywrappers.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/pywrappers.h b/common/pywrappers.h index 725caca8..4e463afd 100644 --- a/common/pywrappers.h +++ b/common/pywrappers.h @@ -140,6 +140,14 @@ template <typename T> struct deref_and_wrap using ret_type = ContextualWrapper<T &>; }; +template <typename T> struct addr_and_unwrap +{ + inline T *operator()(Context *ctx, ContextualWrapper<T &> x) { return &(x.base); } + + using arg_type = ContextualWrapper<T &>; + using ret_type = T *; +}; + // Function wrapper // Zero parameters, one return template <typename Class, typename FuncT, FuncT fn, typename rv_conv> struct fn_wrapper_0a |