// Copyright 2025-2026 Gabriel Bjørnager Jensen.
//
// SPDX: MIT OR Apache-2.0

//! N-vectors.

mod into_iter;
mod n_vec;
mod try_reserve_error;

pub use into_iter::IntoIter;
pub use n_vec::NVec;
pub use try_reserve_error::TryReserveError;

/// The [`n_vec`] macro.
///
/// [`n_vec`]: n_vec_macro::n_vec
///
/// This module is defined so that the [prelude] may
/// re-export the macro without also re-exporting
/// the (public) module of the same name.
///
/// [prelude]: nvec::prelude
pub(crate) mod n_vec_macro {
	/// Constructs a new [`NVec`] object.
	///
	/// [`NVec`]: crate::NVec
	#[macro_export]
	macro_rules! n_vec {
		[] => {{
			$crate::n_vec::NVec::new()
		}};

		[$($elems:expr),+ $(,)?] => {{
			$crate::n_vec::NVec::from_array([$($elems),+])
		}};

		[$elem:expr; $len:expr] => {{
			$crate::n_vec::NVec::from_elem($elem, $len)
		}};
	}

	pub use n_vec;
}
