summaryrefslogtreecommitdiff
path: root/libpqpp/pq-helpers.h
blob: 7861d57e61a28aa3e35c416ce3be5c84c32e305d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef PQ_HELPERS_H
#define PQ_HELPERS_H

#include "libpq-fe.h"
#include <memory>

namespace PQ {
	template<auto func> struct pq_deleter {
		void
		operator()(auto p) const
		{
			func(p);
		}
	};

	using ResultPtr = std::unique_ptr<PGresult, pq_deleter<PQclear>>;
}

#endif