Created
July 28, 2016 13:21
-
-
Save Svetixbot/c67bd7c1e8175aa1a99fccc902c1bbb1 to your computer and use it in GitHub Desktop.
This file contains 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
use std::ops::BitAnd; | |
use std::cmp::PartialEq; | |
use std::num::{One, Zero}; | |
fn even<T>(value: T) -> bool | |
where T: BitAnd<T, Output = T> + PartialEq + One + Zero { | |
value & T::one() == T::zero() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment