Add BitXor to EnumSet.

This commit is contained in:
Joseph Crail 2014-11-07 17:51:38 -05:00
parent 6ee56c9a5f
commit 01b599eb34

View File

@ -16,7 +16,6 @@
use core::prelude::*;
use core::fmt;
// FIXME(conventions): implement BitXor
// FIXME(contentions): implement union family of methods? (general design may be wrong here)
// FIXME(conventions): implement len
@ -196,6 +195,12 @@ impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
}
}
impl<E:CLike> BitXor<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
fn bitxor(&self, e: &EnumSet<E>) -> EnumSet<E> {
EnumSet {bits: self.bits ^ e.bits}
}
}
/// An iterator over an EnumSet
pub struct Items<E> {
index: uint,