3#include <userver/storages/postgres/io/type_mapping.hpp>
4#include <userver/utils/void_t.hpp>
8namespace storages::
postgres::io::detail {
10template <
typename T,
typename = USERVER_NAMESPACE::utils::void_t<>>
11struct ShouldInitMapping : std::false_type {};
14struct ShouldInitMapping<T, USERVER_NAMESPACE::utils::void_t<
decltype(T::init)>> : std::true_type {};
17struct BufferParserBase {
21 explicit BufferParserBase(ValueType& v)
24 using PgMapping = CppToPg<ValueType>;
25 if constexpr (ShouldInitMapping<PgMapping>{}) {
26 ForceReference(PgMapping::init);
32struct BufferParserBase<T&&> {
36 explicit BufferParserBase(ValueType&& v)
39 using PgMapping = CppToPg<ValueType>;
40 if constexpr (ShouldInitMapping<PgMapping>{}) {
41 ForceReference(PgMapping::init);
47struct BufferFormatterBase {
49 const ValueType& value;
50 explicit BufferFormatterBase(
const ValueType& v)