diff options
| author | Joseph Crail <jbcrail@gmail.com> | 2014-11-07 17:51:38 -0500 |
|---|---|---|
| committer | Joseph Crail <jbcrail@gmail.com> | 2014-11-07 18:00:14 -0500 |
| commit | 01b599eb34125b7bc4d01fd7cc24876179ad6798 (patch) | |
| tree | 4943b34123305ca20b4ed24d60fbea890d67c5d0 | |
| parent | 6ee56c9a5febad45865b7d41422b7ae4d996fcaa (diff) | |
Add BitXor to EnumSet.
| -rw-r--r-- | src/libcollections/enum_set.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs index 1acdaef9c91..0737620690b 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -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, |
