diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-14 10:36:45 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-14 13:01:43 +0200 |
commit | 2cd1128555cec70b6ba3d977f6a156b2be1659ad (patch) | |
tree | 453961214140b6ab78e856f702e338aa9487ecef /include/o3tl | |
parent | a1a83ceb8bd2723be49f8282e887da24f4a421f2 (diff) |
fixes and tests for o3tl::typed_flags
create test suite for typed_flags template.
fix the operator&= and operator|= definitions
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Conflicts:
include/o3tl/typed_flags_set.hxx
Change-Id: I1df9ae197889af98a2fd76ff2bc07756c7b14ced
Diffstat (limited to 'include/o3tl')
-rw-r--r-- | include/o3tl/typed_flags_set.hxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/include/o3tl/typed_flags_set.hxx b/include/o3tl/typed_flags_set.hxx index b9b40d8cba09..1aac62512273 100644 --- a/include/o3tl/typed_flags_set.hxx +++ b/include/o3tl/typed_flags_set.hxx @@ -177,7 +177,7 @@ inline typename o3tl::typed_flags<E>::Self operator |( } template<typename E> -inline typename o3tl::typed_flags<E>::Self operator &=(E & lhs, E rhs) { +inline E operator &=(E & lhs, E rhs) { assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) >= 0); assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(rhs) >= 0); lhs = lhs & rhs; @@ -185,16 +185,14 @@ inline typename o3tl::typed_flags<E>::Self operator &=(E & lhs, E rhs) { } template<typename E> -inline typename o3tl::typed_flags<E>::Self operator &=( - E & lhs, typename o3tl::typed_flags<E>::Self rhs) -{ +inline E operator &=(E & lhs, typename o3tl::typed_flags<E>::Self rhs) { assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) >= 0); lhs = lhs & rhs; return lhs; } template<typename E> -inline typename o3tl::typed_flags<E>::Self operator |=(E & lhs, E rhs) { +inline E operator |=(E & lhs, E rhs) { assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) >= 0); assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(rhs) >= 0); lhs = lhs | rhs; @@ -202,9 +200,7 @@ inline typename o3tl::typed_flags<E>::Self operator |=(E & lhs, E rhs) { } template<typename E> -inline typename o3tl::typed_flags<E>::Self operator |=( - E & lhs, typename o3tl::typed_flags<E>::Self rhs) -{ +inline E operator |=(E & lhs, typename o3tl::typed_flags<E>::Self rhs) { assert(static_cast<O3TL_STD_UNDERLYING_TYPE_E>(lhs) >= 0); lhs = lhs | rhs; return lhs; |