# [−] [src] Trait heapless::PowerOfTwo

    pub trait PowerOfTwo { }

The marker trait for type-level numbers which are a power of two.

This trait should not be implemented for anything outside this crate.

# Examples

Here's a working example:

    use typenum::{P4, P8, PowerOfTwo};

    fn only_p2<P: PowerOfTwo>() { }

    only_p2::<P4>();
    only_p2::<P8>();

Numbers which are not a power of two will fail to compile in this example:

ⓘ

    use typenum::{P9, P511, P1023, PowerOfTwo};

    fn only_p2<P: PowerOfTwo>() { }

    only_p2::<P9>();
    only_p2::<P511>();
    only_p2::<P1023>();

## Implementations on Foreign Types

### `impl<U> PowerOfTwo for PInt<U> where
U: NonZero + Unsigned + PowerOfTwo,` [src]

### `impl PowerOfTwo for UInt<UTerm, B1>` [src]

### `impl<U> PowerOfTwo for UInt<U, B0> where
U: Unsigned + PowerOfTwo,` [src]

Loading content...

## Implementors

### `impl PowerOfTwo for B1` [src]

Loading content...