11 template<typename T> struct traits;
14 struct traits<GVariant> {
15 struct delete_functor {
16 void operator()(GVariant * p) const {
24 struct traits<GError> {
25 struct delete_functor {
26 void operator()(GError * p) const {
34 struct traits<GDBusProxy> {
35 struct delete_functor {
36 void operator()(GDBusProxy * p) const {
44 struct traits<GVariantIter> {
45 struct delete_functor {
46 void operator()(GVariantIter * p) const {
48 g_variant_iter_free(p);
54 struct traits<gchar> {
55 struct delete_functor {
56 void operator()(gchar * p) const {
63 template<typename T> using super_ptr =
64 ::std::unique_ptr<T, typename traits<T>::delete_functor>;
66 template<typename T> super_ptr<T> make_super(T* t) {
67 return super_ptr<T>(t);
70 template<typename T> unique_ptr<T> make_unique(T* t) {
71 return unique_ptr<T>(t);