From b7d3b265af36ea309483678aa57e0cd30026aa29 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 8 Oct 2023 16:21:00 +0100 Subject: Make pq_deleter a generic helper --- libpqpp/pq-column.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'libpqpp/pq-column.h') diff --git a/libpqpp/pq-column.h b/libpqpp/pq-column.h index d3400bf..6bf2669 100644 --- a/libpqpp/pq-column.h +++ b/libpqpp/pq-column.h @@ -1,6 +1,7 @@ #ifndef PG_COLUMN_H #define PG_COLUMN_H +#include "pq-helpers.h" #include #include #include @@ -32,15 +33,7 @@ namespace PQ { const Oid oid; // Buffer for PQunescapeBytea - struct pq_deleter { - void - operator()(unsigned char * p) - { - PQfreemem(p); - } - }; - - using BufPtr = std::unique_ptr; + using BufPtr = std::unique_ptr>; mutable BufPtr buf; }; } -- cgit v1.2.3