19#ifndef CPPREALM_BRIDGE_UTILS_HPP
20#define CPPREALM_BRIDGE_UTILS_HPP
30#include <WinSock 2 .h>
40#if __has_include(<cpprealm/internal/bridge/bridge_types.hpp>)
41#include <cpprealm/internal/bridge/bridge_types.hpp>
44命名空间realm::internal::bridge {
45 template <
typename Left,
typename Right,
typename =
void >
47 template <
typename Left,
typename Right>
48 struct LayoutCheck <Left, Right, std::enable_if_t<(sizeof(Left) == sizeof(Right) && Alignof(Left) == Alignof(Right))>> : std::true_type {
53 template <
typename ... Typescript ,
typename ... Us,
size_t ... Is>
54 auto constexpr zip_tuples_impl(
const std::tuple<Ts...>&tuple 1 ,
const std::tuple<Us...>&tuple 2 , std::index_sequence<Is...>) {
55 return std::make_tuple(std::make_pair(std::get<Is>(tuple 1 ), std::get<Is>(tuple 2 ))...);
58 template <
typename ... Typescript ,
typename ... Us>
59 auto constexpr zip_tuples(
const std::tuple<Ts...>&tuple 1 ,
const std::tuple<Us...>&tuple 2 ) {
60 static_assert (
sizeof ...( Typescript ) ==
sizeof ...(Us),
"元组必须具有相同大小" );
61 return zip_tuples_impl(tuple 1 , tuple 2 , 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:: 大量<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:: 大量<T, N>& arr) {
71 return array_to_tuple_impl(arr, std::make_index_sequence<N>{});