Skip to content

Commit 327c17c

Browse files
Test bitset assignment ops return lvalue refs
1 parent 67d167d commit 327c17c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/testEnumUtils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ BOOST_AUTO_TEST_CASE(Operators)
4141
BOOST_TEST(static_cast<unsigned>(b) == 0b001u);
4242
b |= Bitset::B;
4343
BOOST_TEST(static_cast<unsigned>(b) == 0b011u);
44+
(b |= Bitset::A) = Bitset::C;
45+
BOOST_CHECK(b == Bitset::C);
4446
}
4547

4648
{
@@ -49,6 +51,8 @@ BOOST_AUTO_TEST_CASE(Operators)
4951
BOOST_TEST(static_cast<unsigned>(b) == 0b011u);
5052
b &= Bitset::B;
5153
BOOST_TEST(static_cast<unsigned>(b) == 0b010u);
54+
(b &= Bitset::A) = Bitset::C;
55+
BOOST_CHECK(b == Bitset::C);
5256
}
5357
}
5458

0 commit comments

Comments
 (0)