OZO 「お象」
Boost.Asio and libpq based asynchronous PostgreSQL unofficial header-only C++17 client library.
Array Interface Reference

#include <ozo/type_traits.h>

Description

Array concept represents PostgreSQL array.

Array is a Range or Container with fixed or dynamic size. For the type or template which supposed to represent an array ozo::is_array<> should be specialized as std::true_type.

Requirements

#include <ozo/io/array.h> should be included for arrays support.

Concrete models

std::vector, std::list, std::array

Example

The std::vector<> is a dynamic size array and its definition may look like this.

namespace ozo {
template <typename ...Ts>
struct is_array<std::vector<Ts...>> : std::true_type {};
} // namespace ozo

For the std::array<> the definition is slightely different. The std::array<> is a fixed-size container, so it should be pointed via ozo::fit_array_size_impl specialization.

namespace ozo {
template <typename T, std::size_t size>
struct is_array<std::array<T, size>> : std::true_type {};
template <typename T, std::size_t S>
struct fit_array_size_impl<std::array<T, S>> {
static void apply(const std::array<T, S>& array, size_type size) {
if (size != static_cast<size_type>(array.size())) {
}
}
};
} // namespace ozo
ozo::error::bad_array_size
@ bad_array_size
an array size received does not equal to the expected or not supported by the type
Definition: error.h:94
ozo::system_error
boost::system::system_error system_error
Error code contaning exception of the library.
Definition: error.h:45
ozo::size_type
std::int32_t size_type
PostgreSQL size type.
Definition: type_traits.h:265