diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-08 15:28:27 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-03-11 10:16:55 +0200 |
commit | 3146851b6984dff768a88770785c5573ec7f6bbb (patch) | |
tree | f9d86a684576db57e6d2baae29687f01e8f644bd /include | |
parent | fc4b79f76cf030015c5fdc9609afc0482223d198 (diff) |
convert CHILD_ constants to enum class
Change-Id: I1aca134fcc0384df4797cacafa9fbc1ed88d6617
Diffstat (limited to 'include')
-rw-r--r-- | include/o3tl/typed_flags_set.hxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/o3tl/typed_flags_set.hxx b/include/o3tl/typed_flags_set.hxx index 001d3fef6fc7..4b6e4f5909b1 100644 --- a/include/o3tl/typed_flags_set.hxx +++ b/include/o3tl/typed_flags_set.hxx @@ -245,6 +245,23 @@ inline typename o3tl::typed_flags<E>::Self operator |=( return lhs; } +template<typename E> +inline typename o3tl::typed_flags<E>::Self operator ^=(E & lhs, E rhs) { + assert(static_cast<typename o3tl::underlying_type<E>::type>(lhs) >= 0); + assert(static_cast<typename o3tl::underlying_type<E>::type>(rhs) >= 0); + lhs = lhs ^ rhs; + return lhs; +} + +template<typename E> +inline typename o3tl::typed_flags<E>::Self operator ^=( + E & lhs, typename o3tl::typed_flags<E>::Wrap rhs) +{ + assert(static_cast<typename o3tl::underlying_type<E>::type>(lhs) >= 0); + lhs = lhs ^ rhs; + return lhs; +} + #endif /* INCLUDED_O3TL_TYPED_FLAGS_SET_HXX */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |