summaryrefslogtreecommitdiff
path: root/libpqpp/pq-helpers.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-10-08 16:21:00 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-10-08 16:21:00 +0100
commitb7d3b265af36ea309483678aa57e0cd30026aa29 (patch)
treeee0cf81f13ea722f8646380fcf7435ce59ffc5a9 /libpqpp/pq-helpers.h
parentUse unique_ptr for handling unescaped bytea column buffer (diff)
downloadlibdbpp-postgresql-b7d3b265af36ea309483678aa57e0cd30026aa29.tar.bz2
libdbpp-postgresql-b7d3b265af36ea309483678aa57e0cd30026aa29.tar.xz
libdbpp-postgresql-b7d3b265af36ea309483678aa57e0cd30026aa29.zip
Make pq_deleter a generic helper
Diffstat (limited to 'libpqpp/pq-helpers.h')
-rw-r--r--libpqpp/pq-helpers.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/libpqpp/pq-helpers.h b/libpqpp/pq-helpers.h
new file mode 100644
index 0000000..76e5057
--- /dev/null
+++ b/libpqpp/pq-helpers.h
@@ -0,0 +1,14 @@
+#ifndef PQ_HELPERS_H
+#define PQ_HELPERS_H
+
+namespace PQ {
+ template<auto func> struct pq_deleter {
+ void
+ operator()(auto p) const
+ {
+ func(p);
+ }
+ };
+}
+
+#endif