19#ifndef CPPREALM_BRIDGE_UTILS_HPP
20#define CPPREALM_BRIDGE_UTILS_HPP
40#if __has_include(<cpprealm/internal/bridge/bridge_types.hpp>)
41#include <cpprealm/internal/bridge/bridge_types.hpp>
44namespace realm::internal::bridge {
45 template <
typename Esquerda,
typename Direita,
typename =
null>
47 modelo <
typename à esquerda,
typename à direita>
48 estrutura, estrutura layoutCheck<Left, Right, std::enable_if_t<(sizeof(Left) == sizeof(Right) && alineof(Left) == validatef(Right))>> : std::true_type {
52namespace realm::internal {
53 template <
typename... Typescript,
typename... Us,
size_t... Is>
54 auto constexpr zip_tuples_impl(
const std::tuple<Ts...>& tuple1,
const std::tuple<Us...>& tuple2, std::index_sequence<Is...>) {
55 return std::make_tuple(std::make_pair(std::get<Is>(tuple1), std::get<Is>(tuple2))...);
58 template <
typename... Typescript,
typename... Us>
59 auto constexpr zip_tuples(
const std::tuple<Ts...>& tuple1,
const std::tuple<Us...>& tuple2) {
60 estático_assert(
sizeof...(Typescript) ==
sizeof...(Us),
"Tuplas devem ter o mesmo tamanho");
61 return zip_tuples_impl(tuple1, tuple2, std::index_sequence_for<Ts...>());
64 template <
typename T, std::size_t N, std::size_t... Is>
65 auto constexpr array_to_tuple_impl(
const std::array<T, N>& arr, std::index_sequence<Is...>) {
66 return std::make_tuple(arr[Is]...);
69 template <
typename T, std::
size_t N>
70 auto constexpr array_to_tuple(
const std::array<T, N>& arr) {
71 return array_to_tuple_impl(arr, std::make_index_sequence<N>{});