userver: userver/storages/postgres/io/span.hpp Source File
Loading...
Searching...
No Matches
span.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/storages/postgres/io/span.hpp
4/// @brief std::span I/O support
5/// @ingroup userver_postgres_parse_and_format
6
7#include <span>
8
9#include <userver/storages/postgres/io/array_types.hpp>
10
11USERVER_NAMESPACE_BEGIN
12
13namespace storages::postgres::io::traits {
14
15template <typename T, std::size_t Extent>
16struct IsCompatibleContainer<std::span<T, Extent>> : std::true_type {};
17
18namespace detail {
19
20struct SpanHasNoParser;
21
22} // namespace detail
23
24/// Override the array Input<T> = ArrayBinaryParser<T> that would otherwise be
25/// auto-selected via IsCompatibleContainer.
26template <typename T, std::size_t Extent>
27struct Input<std::span<T, Extent>> {
28 using type = detail::SpanHasNoParser;
29};
30
31} // namespace storages::postgres::io::traits
32
33USERVER_NAMESPACE_END