add a comment
This commit is contained in:
parent
1242639b88
commit
c46f185f67
1 changed files with 7 additions and 0 deletions
|
|
@ -48,6 +48,13 @@ impl Idx for u32 {
|
|||
fn index(self) -> usize { self as usize }
|
||||
}
|
||||
|
||||
/// Creates a struct type `S` that can be used as an index with
|
||||
/// `IndexVec` and so on. This struct can be constructed via `S::new`
|
||||
/// (given a `usize`) and converted to a usize with the `index()`
|
||||
/// method (from the `Idx` trait). Internally, the index uses a u32,
|
||||
/// so the index must not exceed `u32::MAX`. You can also customize
|
||||
/// things like the `Debug` impl, what traits are derived, and so
|
||||
/// forth.
|
||||
#[macro_export]
|
||||
macro_rules! newtype_index {
|
||||
// ---- public rules ----
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue