Created
September 5, 2019 19:51
-
-
Save DreamLinuxer/d7e67053e2b8a480a0b34f6d90301513 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait Encoding { | |
fn encode (b : bool) -> Self; | |
fn decode (&self) -> bool; | |
} | |
pub trait Comp : Encoding { | |
fn and(l:Self,r:Self) -> Self; | |
} | |
fn test<T : Comp> (l:T,r:T) -> T { | |
T::and(l,r) | |
} | |
fn main() { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait Encoding { | |
fn encode (b : bool) -> Self; | |
fn decode (&self) -> bool; | |
} | |
pub trait Comp : Encoding { | |
fn and(l:Self,r:Self) -> Self; | |
} | |
fn test<T : Comp> (l:T,r:T) -> T { | |
T::and(l,r) | |
} | |
fn main() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment