# [−][src]Macro typenum::cmp

    macro_rules! cmp {
        ($a:ident < $b:ty) => { ... };
        ($a:ty, < $b:ty) => { ... };
        ($a:ident == $b:ty) => { ... };
        ($a:ty, == $b:ty) => { ... };
        ($a:ident > $b:ty) => { ... };
        ($a:ty, > $b:ty) => { ... };
        ($a:ident <= $b:ty) => { ... };
        ($a:ty, <= $b:ty) => { ... };
        ($a:ident != $b:ty) => { ... };
        ($a:ty, != $b:ty) => { ... };
        ($a:ident >= $b:ty) => { ... };
        ($a:ty, >= $b:ty) => { ... };
    }

Deprecated since 1.9.0:

use the `op!` macro instead

A convenience macro for comparing type numbers. Use `op!` instead.

Due to the intricacies of the macro system, if the left-hand operand is more complex than a simple `ident`, you must place a comma between it and the comparison sign.

For example, you can do `cmp!(P5 > P3)` or `cmp!(typenum::P5, > typenum::P3)` but not `cmp!(typenum::P5 > typenum::P3)`.

The result of this comparison will always be one of `True` (aka `B1`) or `False` (aka `B0`).

# Example

    #[macro_use] extern crate typenum;
    use typenum::consts::*;
    use typenum::Bit;

    fn main() {
    type Result = cmp!(P9 == op!(P1 + P2 * (P2 - N2)));
    assert_eq!(Result::to_bool(), true);
    }

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)