OZO 「お象」
Boost.Asio and libpq based asynchronous PostgreSQL unofficial header-only C++17 client library.
ozo::size_of_impl< T, typename > Struct Template Reference

#include <ozo/io/size_of.h>

Description

template<typename T, typename>
struct ozo::size_of_impl< T, typename >

ozo::size_of implementation functor

This template is used to implement object binary representation size calculation including all the meta-information is used for the PostgreSQL binary protocol. By default it provides static_assert failure - which means that there is no know algorithm to calculate size. There are default specializations for different common types and concepts, incluiding #BuiltIn, Array, Composite, #Nullable.

Template Parameters
T— type to examine.
<anonymous>— SFINAE overloading rule.
Note
This template has to be defined in case of defining custom IO via ozo::send_impl and ozo::recv_impl.

Example

This is how it can be implemented for the static size type (exposition only):

template <>
struct size_of_impl<std::nullptr_t> {
static constexpr auto apply(std::nullptr_t) noexcept {
return null_state_size;
}
};