Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fcard/typenum-convert

Experimental support for `const_generic_exprs` for the typenum crate.
https://github.com/fcard/typenum-convert

Last synced: 21 days ago
JSON representation

Experimental support for `const_generic_exprs` for the typenum crate.

Awesome Lists containing this project

README

        

# Try It
Add this to your Cargo.toml:

```
[dependencies.typenum-convert]
git = "https://github.com/fcard/typenum-convert"
branch = "1.0.0"
```

# Example

```rs
#![feature(const_generic_exprs)]
#![allow(incomplete_features)]

use typenum_convert::*;
use typenum::{U4, Unsigned};
use std::ops::Add;

fn main() {
type Four = U4;
type Eight = T32<{2 * Four::U32}>;
type Twelve = T32<{Eight::U32 + Four::U32}>;
println!("{} {} {}",
Four::U32, Eight::U32, Twelve::U32);
}
```