#include <cstdlib>
#include <cstdarg>
#include <functional>
+#include <string>
/* ensure version */
#ifndef AFB_BINDING_VERSION
friend class req;
afb_req_t req_;
contextclass(afb_req_t r) : req_(r) {}
+ static void default_destroyer(T*t) { delete t; }
public:
inline operator T *() const { return get(); }
nullptr));
}
- inline void set(T *value, void (*destroyer)(T*) = [](T*t){delete t;}) const {
+ inline void set(T *value, void (*destroyer)(T*) = default_destroyer) const {
afb_req_context(req_, 1,
nullptr,
reinterpret_cast<void(*)(void*)>(destroyer),
session,
auth,
glob,
- (void*)(&callback)
+ *(void**)(&callback)
);
}