1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-08-20 15:40:50 +00:00

Fix build error when passing a vector<string_ref> to query()

This commit is contained in:
King_DuckZ 2016-05-13 20:46:13 +02:00
parent 61fa9628a5
commit 537023dbfa
3 changed files with 22 additions and 11 deletions

View file

@ -26,6 +26,13 @@
#endif
namespace pq {
namespace {
const Connection* assert_not_null_and_return (const Connection* parConn) {
assert(parConn);
return parConn;
}
} //unnamed namespace
namespace implem {
template <
typename Expected,
@ -76,10 +83,12 @@ namespace pq {
return;
}
get_pqlib_c_type_struct_arr::get_pqlib_c_type_struct_arr (const Connection& parConn) :
m_par(parConn.make_empty_params())
get_pqlib_c_type_struct_arr::get_pqlib_c_type_struct_arr (const Connection* parConn) :
m_par(assert_not_null_and_return(parConn)->make_empty_params()),
m_conn(parConn)
{
static_assert_size<PGarray, storage>();
assert(m_conn);
PGarray arr;
std::fill(reinterpret_cast<char*>(&arr), reinterpret_cast<char*>(&arr) + sizeof(PGarray), '\0');