// Copyright 2025 Gabriel Bjørnager Jensen.

mod test;

use crate::IntLeast32;

use core::convert::Infallible;

/// Denotes a signed integer that is at least as wide as [`i64`].
///
/// # Safety
///
/// Only primitive, signed, integral types that fit the size requirement may implement this type.
pub trait IntLeast64
where
	Self:
		crate::seal::IntLeast64
		+ IntLeast32
		+ From<i64>
		+ From<u32>
		+ TryFrom<i64, Error = Infallible>
		+ TryFrom<u32, Error = Infallible>,
{}

macro_rules! impl_int_least64 {
	{ $($Ty:ty),*$(,)? } => {$(
		impl ::multitype::seal::IntLeast64 for $Ty {}

		impl ::multitype::IntLeast64 for $Ty {}
	)*};
}

impl_int_least64! {
	i64,
	i128,
}
