summaryrefslogtreecommitdiffstats
path: root/include/o3tl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-03-08 15:28:27 +0200
committerNoel Grandin <noel@peralex.com>2015-03-11 10:16:55 +0200
commit3146851b6984dff768a88770785c5573ec7f6bbb (patch)
treef9d86a684576db57e6d2baae29687f01e8f644bd /include/o3tl
parentconvert tExternalDataType to enum class (diff)
downloadcore-3146851b6984dff768a88770785c5573ec7f6bbb.tar.gz
core-3146851b6984dff768a88770785c5573ec7f6bbb.zip
convert CHILD_ constants to enum class
Change-Id: I1aca134fcc0384df4797cacafa9fbc1ed88d6617
Diffstat (limited to 'include/o3tl')
-rw-r--r--include/o3tl/typed_flags_set.hxx17
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: */