SHARE
TWEET

Untitled

a guest Jun 18th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #![feature(const_generics)]
  2.  
  3. struct BInt<const From: i32, const To: i32>(i32);
  4.  
  5. impl<const F: i32, const T: i32> BInt<{F}, {T}> {
  6.     pub const fn new(x: i32) -> Self {
  7.         Self(x)
  8.     }
  9. }
  10.  
  11. fn main() {
  12.     let x: BInt<{0},{10}>= BInt::new(3);
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top