CTuple derives

This commit is contained in:
Intege-rs
2025-03-06 03:38:44 -05:00
parent e0cfc13287
commit 362d44c712

View File

@@ -1,3 +1,4 @@
use core::fmt::{Debug, Formatter};
pub trait Tuple2CTuple { pub trait Tuple2CTuple {
type CTuple; type CTuple;
@@ -8,6 +9,7 @@ macro_rules! define_tuple {
($struct_name:ident, $module_name:ident, $($T:ident),*) => { ($struct_name:ident, $module_name:ident, $($T:ident),*) => {
pub mod $module_name { pub mod $module_name {
#[repr(C)] #[repr(C)]
#[derive(Debug, Clone, Default)]
pub struct $struct_name<$($T),*>($(pub $T),*); pub struct $struct_name<$($T),*>($(pub $T),*);
impl<$($T),*> super::Tuple2CTuple for ($($T,)*) { impl<$($T),*> super::Tuple2CTuple for ($($T,)*) {