OZO 「お象」
Boost.Asio and libpq based asynchronous PostgreSQL unofficial header-only C++17 client library.
|
|
3 #include <ozo/type_traits.h>
53 template <
typename T,
typename = std::
void_t<>>
58 template <
typename T,
typename = std::
void_t<>>
59 struct size_of_default_impl {
60 static constexpr
auto apply(
const T&) noexcept {
67 static constexpr
auto apply(
const T& v) noexcept(noexcept(std::size(v))){
68 return std::size(v) *
sizeof(decltype(*
std::begin(v)));
72 template <
typename T,
typename = std::
void_t<>>
73 struct size_of_impl_dispatcher {
using type = size_of_impl<std::decay_t<T>>; };
75 template <
typename T,
typename Tag>
76 struct size_of_impl_dispatcher<strong_typedef_wrapper<T, Tag>> {
using type = size_of_impl<std::decay_t<T>>; };
79 using get_size_of_impl =
typename size_of_impl_dispatcher<unwrap_type<T>>::type;
104 template <
typename T>
106 static_assert(
HasDefinition<T>,
"the type has not been defined with PostgreSQL type traits");
110 template <
typename T,
typename>
111 struct size_of_impl : detail::size_of_default_impl<T> {};
126 template <
typename T>
145 template <
typename T>
constexpr decltype(auto) unwrap(T &&v) noexcept(noexcept(unwrap_impl< std::decay_t< T >>::apply(std::forward< T >(v))))
Unwraps argument underlying value or forwards the argument.
Definition: unwrap.h:57
Condition indicates if type has corresponding type traits for PostgreSQL.
constexpr size_type size_of(const T &v)
Returns size of object binary representation in bytes.
Definition: size_of.h:105
constexpr size_type frame_size(const T &v)
Returns size of full IO frame.
Definition: size_of.h:146
constexpr auto DynamicSize
Condition indicates if the specified type is has dynamic size.
Definition: type_traits.h:318
ozo::size_of implementation functor
Definition: size_of.h:54
Type Require
Concept requirement emulation.
Definition: concept.h:54
Type traits template forward declaration.
Definition: type_traits.h:208
std::int32_t size_type
PostgreSQL size type.
Definition: type_traits.h:265
decltype(auto) begin(ConnectionProvider &&provider, TimeConstraint time_constraint, CompletionToken &&token)
Start new transaction.
constexpr decltype(auto) is_null(const T &v) noexcept(noexcept(is_null_impl< T >::apply(v)))
Indicates if value is in null state.
Definition: nullable.h:85
::Oid oid_t
PostgreSQL OID type - object identifier.
Definition: type_traits.h:70
constexpr size_type data_frame_size(const T &v)
Returns size of IO data frame.
Definition: size_of.h:127