Implement a read/write operator[] for SmallBitVector with a proxy class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102709 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2010-04-30 12:29:39 +00:00
parent 1e44aa0412
commit b252fbd179
2 changed files with 43 additions and 3 deletions

View File

@ -176,4 +176,12 @@ TEST(SmallBitVectorTest, CompoundAssignment) {
EXPECT_EQ(100U, A.size());
}
TEST(SmallBitVectorTest, ProxyIndex) {
SmallBitVector Vec(3);
EXPECT_TRUE(Vec.none());
Vec[0] = Vec[1] = Vec[2] = true;
EXPECT_EQ(Vec.size(), Vec.count());
Vec[2] = Vec[1] = Vec[0] = false;
EXPECT_TRUE(Vec.none());
}
}