use core::{borrow::{Borrow, BorrowMut}, ops::{Index, IndexMut, Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive}, ptr::Pointee};
use super::*;
pub const trait Array: private::Array + ~const AsArray + ~const IntoArray + Pointee<Metadata = ()>
+ IntoIterator<Item = <Self as AsSlice>::Elem>
+ ~const AsRef<[<Self as AsSlice>::Elem]>
+ ~const AsMut<[<Self as AsSlice>::Elem]>
+ ~const Borrow<[<Self as AsSlice>::Elem]>
+ ~const BorrowMut<[<Self as AsSlice>::Elem]>
+ ~const IndexMut<usize, Output = <[<Self as AsSlice>::Elem] as Index<usize>>::Output>
+ ~const IndexMut<Range<usize>, Output = <[<Self as AsSlice>::Elem] as Index<Range<usize>>>::Output>
+ ~const IndexMut<RangeInclusive<usize>, Output = <[<Self as AsSlice>::Elem] as Index<RangeInclusive<usize>>>::Output>
+ ~const IndexMut<RangeFrom<usize>, Output = <[<Self as AsSlice>::Elem] as Index<RangeFrom<usize>>>::Output>
+ ~const IndexMut<RangeTo<usize>, Output = <[<Self as AsSlice>::Elem] as Index<RangeTo<usize>>>::Output>
+ ~const IndexMut<RangeToInclusive<usize>, Output = <[<Self as AsSlice>::Elem] as Index<RangeToInclusive<usize>>>::Output>
+ ~const IndexMut<RangeFull, Output = <[<Self as AsSlice>::Elem] as Index<RangeFull>>::Output>
{
}
impl<T, const LENGTH: usize> const Array for [T; LENGTH]
{
}
#[cfg(test)]
mod test
{
#[test]
fn it_works()
{
use crate::*;
type Arr3 = [i8; 3];
const A: Arr3 = [1, 2, 3];
const fn first<'a, T: ~const Array>(array: &'a T) -> Option<&'a <T as AsSlice>::Elem>
where
[(); T::LENGTH]: {
array.as_array().first()
}
assert_eq!(first(&A), Some(&1));
assert_eq!(Arr3::LENGTH, 3);
}
}