# [−][src]Trait typenum::type_operators::Same

    pub trait Same<Rhs = Self> {
        type Output;
    }

A type operator that ensures that `Rhs` is the same as `Self`, it is mainly useful for writing macros that can take arbitrary binary or unary operators.

`Same` is implemented generically for all types; it should never need to be implemented for anything else.

Note that Rust lazily evaluates types, so this will only fail for two different types if the `Output` is used.

# Example

    use typenum::{Same, U4, U5, Unsigned};

    assert_eq!(<U5 as Same<U5>>::Output::to_u32(), 5);

    // Only an error if we use it:
    type Undefined = <U5 as Same<U4>>::Output;
    // Compiler error:
    // Undefined::to_u32();

## Associated Types

### `type Output`

Should always be `Self`

Loading content...

## Implementors

### `impl<T> Same<T> for T`[src]

#### `type Output = T`

Loading content...

# 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`)