13#ifndef PQXX_H_STATEMENT_PARAMETER
14#define PQXX_H_STATEMENT_PARAMETER
21#include "pqxx/binarystring.hxx"
22#include "pqxx/strconv.hxx"
23#include "pqxx/util.hxx"
28template<
typename ITERATOR>
29constexpr inline auto const iterator_identity{
30 [](
decltype(*std::declval<ITERATOR>()) x) {
return x; }};
34template<
typename IT,
typename ACCESSOR = decltype(iterator_
identity<IT>)>
40 m_begin(begin), m_end(end), m_accessor(iterator_identity<IT>)
49 m_begin(begin), m_end(end), m_accessor(acc)
68 constexpr IT begin() const noexcept {
return m_begin; }
69 constexpr IT end() const noexcept {
return m_end; }
71 constexpr auto access(
decltype(*std::declval<IT>()) value)
const
72 ->
decltype(std::declval<ACCESSOR>()(value))
74 return m_accessor(value);
78 IT
const m_begin, m_end;
79 ACCESSOR m_accessor = iterator_identity<IT>;
102 void reserve(std::size_t n) &;
Definition statement_parameters.hxx:36
constexpr dynamic_params(C &container)
Wrap a container.
Definition statement_parameters.hxx:54
constexpr dynamic_params(IT begin, IT end)
Wrap a sequence of pointers or iterators.
Definition statement_parameters.hxx:39
constexpr dynamic_params(C &container, ACCESSOR &acc)
Wrap a container.
Definition statement_parameters.hxx:64
constexpr dynamic_params(IT begin, IT end, ACCESSOR &acc)
Wrap a sequence of pointers or iterators.
Definition statement_parameters.hxx:48
Internal items for libpqxx' own use. Do not use these yourself.
Definition encodings.cxx:33
Internal type: encode statement parameters.
Definition statement_parameters.hxx:95
c_params(c_params const &)=delete
Copying these objects is pointless and expensive. Don't do it.
std::vector< int > lengths
As used by libpq: lengths of non-null arguments, in bytes.
Definition statement_parameters.hxx:107
std::vector< format > formats
As used by libpq: effectively boolean "is this a binary parameter?".
Definition statement_parameters.hxx:109
std::vector< char const * > values
As used by libpq: pointers to parameter values.
Definition statement_parameters.hxx:105