llvm.org GIT mirror llvm / cb89afc
Add a SmallBitVector class, which mimics BitVector but uses only a single pointer (PointerIntPair) member. In "small" mode, the pointer field is reinterpreted as a set of bits. In "large" mode, the pointer points to a heap-allocated object. Also, give BitVector empty and swap functions. And, add some simple unittests for BitVector and SmallBitVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92730 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 9 years ago
4 changed file(s) with 671 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
9494 delete[] Bits;
9595 }
9696
97 /// empty - Tests whether there are no bits in this bitvector.
98 bool empty() const { return Size == 0; }
99
97100 /// size - Returns the number of bits in this bitvector.
98101 unsigned size() const { return Size; }
99102
340343 return *this;
341344 }
342345
346 void swap(BitVector &RHS) {
347 std::swap(Bits, RHS.Bits);
348 std::swap(Size, RHS.Size);
349 std::swap(Capacity, RHS.Capacity);
350 }
351
343352 private:
344353 unsigned NumBitWords(unsigned S) const {
345354 return (S + BITWORD_SIZE-1) / BITWORD_SIZE;
405414 }
406415
407416 } // End llvm namespace
417
418 namespace std {
419 /// Implement std::swap in terms of BitVector swap.
420 inline void
421 swap(llvm::BitVector &LHS, llvm::BitVector &RHS) {
422 LHS.swap(RHS);
423 }
424 }
425
408426 #endif
0 //===- llvm/ADT/SmallBitVector.h - 'Normally small' bit vectors -*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the SmallBitVector class.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef LLVM_ADT_SMALLBITVECTOR_H
14 #define LLVM_ADT_SMALLBITVECTOR_H
15
16 #include "llvm/ADT/BitVector.h"
17 #include "llvm/ADT/PointerIntPair.h"
18 #include "llvm/Support/MathExtras.h"
19 #include
20
21 namespace llvm {
22
23 /// SmallBitVector - This is a 'bitvector' (really, a variable-sized bit array),
24 /// optimized for the case when the array is small. It contains one
25 /// pointer-sized field, which is directly used as a plain collection of bits
26 /// when possible, or as a pointer to a larger heap-allocated array when
27 /// necessary. This allows normal "small" cases to be fast without losing
28 /// generality for large inputs.
29 ///
30 class SmallBitVector {
31 // TODO: In "large" mode, a pointer to a BitVector is used, leading to an
32 // unnecessary level of indirection. It would be more efficient to use a
33 // pointer to memory containing size, allocation size, and the array of bits.
34 PointerIntPair X;
35
36 // The number of bits in this class.
37 static const size_t NumBaseBits = sizeof(X) * CHAR_BIT;
38
39 // One bit is used to discriminate between small and large mode. The
40 // remaining bits are used for the small-mode representation.
41 static const size_t SmallNumRawBits = NumBaseBits - 1;
42
43 // A few more bits are used to store the size of the bit set in small mode.
44 // Theoretically this is a ceil-log2. These bits are encoded in the most
45 // significant bits of the raw bits.
46 static const size_t SmallNumSizeBits = (NumBaseBits == 32 ? 5 :
47 NumBaseBits == 64 ? 6 :
48 SmallNumRawBits);
49
50 // The remaining bits are used to store the actual set in small mode.
51 static const size_t SmallNumDataBits = SmallNumRawBits - SmallNumSizeBits;
52
53 bool isSmall() const {
54 return X.getInt();
55 }
56
57 void switchToSmall(uintptr_t NewSmallBits, size_t NewSize) {
58 X.setInt(true);
59 setSmallSize(NewSize);
60 setSmallBits(NewSmallBits);
61 }
62
63 void switchToLarge(BitVector *BV) {
64 X.setInt(false);
65 X.setPointer(BV);
66 }
67
68 // Return all the bits used for the "small" representation; this includes
69 // bits for the size as well as the element bits.
70 uintptr_t getSmallRawBits() const {
71 return reinterpret_cast(X.getPointer()) >> 1;
72 }
73
74 void setSmallRawBits(uintptr_t NewRawBits) {
75 return X.setPointer(reinterpret_cast(NewRawBits << 1));
76 }
77
78 // Return the size.
79 size_t getSmallSize() const {
80 return getSmallRawBits() >> SmallNumDataBits;
81 }
82
83 void setSmallSize(size_t Size) {
84 setSmallRawBits(getSmallBits() | (Size << SmallNumDataBits));
85 }
86
87 // Return the element bits.
88 uintptr_t getSmallBits() const {
89 return getSmallRawBits() & ~(~uintptr_t(0) << SmallNumDataBits);
90 }
91
92 void setSmallBits(uintptr_t NewBits) {
93 setSmallRawBits((getSmallRawBits() & (~uintptr_t(0) << SmallNumDataBits)) |
94 (NewBits & ~(~uintptr_t(0) << getSmallSize())));
95 }
96
97 public:
98 /// SmallBitVector default ctor - Creates an empty bitvector.
99 SmallBitVector() : X(0, 1) {}
100
101 /// SmallBitVector ctor - Creates a bitvector of specified number of bits. All
102 /// bits are initialized to the specified value.
103 explicit SmallBitVector(unsigned s, bool t = false) : X(0, 1) {
104 if (s <= SmallNumRawBits)
105 switchToSmall(t ? ~uintptr_t(0) : 0, s);
106 else
107 switchToLarge(new BitVector(s, t));
108 }
109
110 /// SmallBitVector copy ctor.
111 SmallBitVector(const SmallBitVector &RHS) {
112 if (RHS.isSmall())
113 X = RHS.X;
114 else
115 switchToLarge(new BitVector(*RHS.X.getPointer()));
116 }
117
118 ~SmallBitVector() {
119 if (!isSmall())
120 delete X.getPointer();
121 }
122
123 /// empty - Tests whether there are no bits in this bitvector.
124 bool empty() const {
125 return isSmall() ? getSmallSize() == 0 : X.getPointer()->empty();
126 }
127
128 /// size - Returns the number of bits in this bitvector.
129 size_t size() const {
130 return isSmall() ? getSmallSize() : X.getPointer()->size();
131 }
132
133 /// count - Returns the number of bits which are set.
134 unsigned count() const {
135 if (isSmall()) {
136 uintptr_t Bits = getSmallBits();
137 if (sizeof(uintptr_t) * CHAR_BIT == 32)
138 return CountPopulation_32(Bits);
139 if (sizeof(uintptr_t) * CHAR_BIT == 64)
140 return CountPopulation_64(Bits);
141 assert(0 && "Unsupported!");
142 }
143 return X.getPointer()->count();
144 }
145
146 /// any - Returns true if any bit is set.
147 bool any() const {
148 if (isSmall())
149 return getSmallBits() != 0;
150 return X.getPointer()->any();
151 }
152
153 /// none - Returns true if none of the bits are set.
154 bool none() const {
155 if (isSmall())
156 return getSmallBits() == 0;
157 return X.getPointer()->none();
158 }
159
160 /// find_first - Returns the index of the first set bit, -1 if none
161 /// of the bits are set.
162 int find_first() const {
163 if (isSmall()) {
164 uintptr_t Bits = getSmallBits();
165 if (sizeof(uintptr_t) * CHAR_BIT == 32)
166 return CountTrailingZeros_32(Bits);
167 if (sizeof(uintptr_t) * CHAR_BIT == 64)
168 return CountTrailingZeros_64(Bits);
169 assert(0 && "Unsupported!");
170 }
171 return X.getPointer()->find_first();
172 }
173
174 /// find_next - Returns the index of the next set bit following the
175 /// "Prev" bit. Returns -1 if the next set bit is not found.
176 int find_next(unsigned Prev) const {
177 if (isSmall()) {
178 uintptr_t Bits = getSmallBits();
179 // Mask off previous bits.
180 Bits &= ~uintptr_t(0) << Prev;
181 if (sizeof(uintptr_t) * CHAR_BIT == 32)
182 return CountTrailingZeros_32(Bits);
183 if (sizeof(uintptr_t) * CHAR_BIT == 64)
184 return CountTrailingZeros_64(Bits);
185 assert(0 && "Unsupported!");
186 }
187 return X.getPointer()->find_next(Prev);
188 }
189
190 /// clear - Clear all bits.
191 void clear() {
192 if (!isSmall())
193 delete X.getPointer();
194 switchToSmall(0, 0);
195 }
196
197 /// resize - Grow or shrink the bitvector.
198 void resize(unsigned N, bool t = false) {
199 if (!isSmall()) {
200 X.getPointer()->resize(N, t);
201 } else if (getSmallSize() >= N) {
202 setSmallSize(N);
203 setSmallBits(getSmallBits());
204 } else {
205 BitVector *BV = new BitVector(N, t);
206 uintptr_t OldBits = getSmallBits();
207 for (size_t i = 0, e = getSmallSize(); i != e; ++i)
208 (*BV)[i] = (OldBits >> i) & 1;
209 switchToLarge(BV);
210 }
211 }
212
213 void reserve(unsigned N) {
214 if (isSmall()) {
215 if (N > SmallNumDataBits) {
216 uintptr_t OldBits = getSmallRawBits();
217 size_t SmallSize = getSmallSize();
218 BitVector *BV = new BitVector(SmallSize);
219 for (size_t i = 0; i < SmallSize; ++i)
220 if ((OldBits >> i) & 1)
221 BV->set(i);
222 BV->reserve(N);
223 switchToLarge(BV);
224 }
225 } else {
226 X.getPointer()->reserve(N);
227 }
228 }
229
230 // Set, reset, flip
231 SmallBitVector &set() {
232 if (isSmall())
233 setSmallBits(~uintptr_t(0));
234 else
235 X.getPointer()->set();
236 return *this;
237 }
238
239 SmallBitVector &set(unsigned Idx) {
240 if (isSmall())
241 setSmallBits(getSmallBits() | (uintptr_t(1) << Idx));
242 else
243 X.getPointer()->set(Idx);
244 return *this;
245 }
246
247 SmallBitVector &reset() {
248 if (isSmall())
249 setSmallBits(0);
250 else
251 X.getPointer()->reset();
252 return *this;
253 }
254
255 SmallBitVector &reset(unsigned Idx) {
256 if (isSmall())
257 setSmallBits(getSmallBits() & ~(uintptr_t(1) << Idx));
258 else
259 X.getPointer()->reset(Idx);
260 return *this;
261 }
262
263 SmallBitVector &flip() {
264 if (isSmall())
265 setSmallBits(~getSmallBits());
266 else
267 X.getPointer()->flip();
268 return *this;
269 }
270
271 SmallBitVector &flip(unsigned Idx) {
272 if (isSmall())
273 setSmallBits(getSmallBits() ^ (uintptr_t(1) << Idx));
274 else
275 X.getPointer()->flip(Idx);
276 return *this;
277 }
278
279 // No argument flip.
280 SmallBitVector operator~() const {
281 return SmallBitVector(*this).flip();
282 }
283
284 // Indexing.
285 // TODO: Add an index operator which returns a "reference" (proxy class).
286 bool operator[](unsigned Idx) const {
287 assert(Idx < size() && "Out-of-bounds Bit access.");
288 if (isSmall())
289 return ((getSmallBits() >> Idx) & 1) != 0;
290 return X.getPointer()->operator[](Idx);
291 }
292
293 bool test(unsigned Idx) const {
294 return (*this)[Idx];
295 }
296
297 // Comparison operators.
298 bool operator==(const SmallBitVector &RHS) const {
299 if (size() != RHS.size())
300 return false;
301 if (isSmall())
302 return getSmallBits() == RHS.getSmallBits();
303 else
304 return *X.getPointer() == *RHS.X.getPointer();
305 }
306
307 bool operator!=(const SmallBitVector &RHS) const {
308 return !(*this == RHS);
309 }
310
311 // Intersection, union, disjoint union.
312 BitVector &operator&=(const SmallBitVector &RHS); // TODO: implement
313
314 BitVector &operator|=(const SmallBitVector &RHS); // TODO: implement
315
316 BitVector &operator^=(const SmallBitVector &RHS); // TODO: implement
317
318 // Assignment operator.
319 const SmallBitVector &operator=(const SmallBitVector &RHS) {
320 if (isSmall()) {
321 if (RHS.isSmall())
322 X = RHS.X;
323 else
324 switchToLarge(new BitVector(*RHS.X.getPointer()));
325 } else {
326 if (!RHS.isSmall())
327 *X.getPointer() = *RHS.X.getPointer();
328 else {
329 delete X.getPointer();
330 X = RHS.X;
331 }
332 }
333 return *this;
334 }
335
336 void swap(SmallBitVector &RHS) {
337 std::swap(X, RHS.X);
338 }
339 };
340
341 inline SmallBitVector
342 operator&(const SmallBitVector &LHS, const SmallBitVector &RHS) {
343 SmallBitVector Result(LHS);
344 Result &= RHS;
345 return Result;
346 }
347
348 inline SmallBitVector
349 operator|(const SmallBitVector &LHS, const SmallBitVector &RHS) {
350 SmallBitVector Result(LHS);
351 Result |= RHS;
352 return Result;
353 }
354
355 inline SmallBitVector
356 operator^(const SmallBitVector &LHS, const SmallBitVector &RHS) {
357 SmallBitVector Result(LHS);
358 Result ^= RHS;
359 return Result;
360 }
361
362 } // End llvm namespace
363
364 namespace std {
365 /// Implement std::swap in terms of BitVector swap.
366 inline void
367 swap(llvm::SmallBitVector &LHS, llvm::SmallBitVector &RHS) {
368 LHS.swap(RHS);
369 }
370 }
371
372 #endif
0 //===- llvm/unittest/ADT/BitVectorTest.cpp - BitVector tests --------------===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/ADT/BitVector.h"
10 #include "gtest/gtest.h"
11
12 using namespace llvm;
13
14 namespace {
15
16 TEST(BitVectorTest, TrivialOperation) {
17 BitVector Vec;
18 EXPECT_EQ(0U, Vec.count());
19 EXPECT_EQ(0U, Vec.size());
20 EXPECT_FALSE(Vec.any());
21 EXPECT_TRUE(Vec.none());
22 EXPECT_TRUE(Vec.empty());
23
24 Vec.resize(5, true);
25 EXPECT_EQ(5U, Vec.count());
26 EXPECT_EQ(5U, Vec.size());
27 EXPECT_TRUE(Vec.any());
28 EXPECT_FALSE(Vec.none());
29 EXPECT_FALSE(Vec.empty());
30
31 Vec.resize(11);
32 EXPECT_EQ(5U, Vec.count());
33 EXPECT_EQ(11U, Vec.size());
34 EXPECT_TRUE(Vec.any());
35 EXPECT_FALSE(Vec.none());
36 EXPECT_FALSE(Vec.empty());
37
38 BitVector Inv = ~Vec;
39 EXPECT_EQ(6U, Inv.count());
40 EXPECT_EQ(11U, Inv.size());
41 EXPECT_TRUE(Inv.any());
42 EXPECT_FALSE(Inv.none());
43 EXPECT_FALSE(Inv.empty());
44
45 EXPECT_FALSE(Inv == Vec);
46 EXPECT_TRUE(Inv != Vec);
47 Vec = ~Vec;
48 EXPECT_TRUE(Inv == Vec);
49 EXPECT_FALSE(Inv != Vec);
50
51 // Add some "interesting" data to Vec.
52 Vec.resize(23, true);
53 Vec.resize(25, false);
54 Vec.resize(26, true);
55 Vec.resize(29, false);
56 Vec.resize(33, true);
57 Vec.resize(61, false);
58 unsigned Count = 0;
59 for (unsigned i = Vec.find_first(); i != -1u; i = Vec.find_next(i)) {
60 ++Count;
61 EXPECT_TRUE(Vec[i]);
62 EXPECT_TRUE(Vec.test(i));
63 }
64 EXPECT_EQ(Count, Vec.count());
65 EXPECT_EQ(Count, 23u);
66 EXPECT_FALSE(Vec[0]);
67 EXPECT_TRUE(Vec[32]);
68 EXPECT_FALSE(Vec[60]);
69
70 BitVector Copy = Vec;
71 BitVector Alt(3, false);
72 Alt.resize(6, true);
73 std::swap(Alt, Vec);
74 EXPECT_TRUE(Copy == Alt);
75 EXPECT_TRUE(Vec.size() == 6);
76 EXPECT_TRUE(Vec.count() == 3);
77 EXPECT_TRUE(Vec.find_first() == 3);
78 std::swap(Copy, Vec);
79
80 // Add some more "interesting" data.
81 Vec.resize(68, true);
82 Vec.resize(78, false);
83 Vec.resize(89, true);
84 Vec.resize(90, false);
85 Vec.resize(91, true);
86 Vec.resize(130, false);
87 Count = 0;
88 for (unsigned i = Vec.find_first(); i != -1u; i = Vec.find_next(i)) {
89 ++Count;
90 EXPECT_TRUE(Vec[i]);
91 EXPECT_TRUE(Vec.test(i));
92 }
93 EXPECT_EQ(Count, Vec.count());
94 EXPECT_EQ(Count, 42u);
95 EXPECT_FALSE(Vec[0]);
96 EXPECT_TRUE(Vec[32]);
97 EXPECT_FALSE(Vec[60]);
98 EXPECT_FALSE(Vec[129]);
99
100 Vec.flip(60);
101 EXPECT_TRUE(Vec[60]);
102 EXPECT_EQ(Count + 1, Vec.count());
103 Vec.flip(60);
104 EXPECT_FALSE(Vec[60]);
105 EXPECT_EQ(Count, Vec.count());
106
107 Vec.reset(32);
108 EXPECT_FALSE(Vec[32]);
109 EXPECT_EQ(Count - 1, Vec.count());
110 Vec.set(32);
111 EXPECT_TRUE(Vec[32]);
112 EXPECT_EQ(Count, Vec.count());
113
114 Vec.flip();
115 EXPECT_EQ(Vec.size() - Count, Vec.count());
116
117 Vec.reset();
118 EXPECT_EQ(0U, Vec.count());
119 EXPECT_EQ(130U, Vec.size());
120 EXPECT_FALSE(Vec.any());
121 EXPECT_TRUE(Vec.none());
122 EXPECT_FALSE(Vec.empty());
123
124 Inv = ~BitVector();
125 EXPECT_EQ(0U, Inv.count());
126 EXPECT_EQ(0U, Inv.size());
127 EXPECT_FALSE(Inv.any());
128 EXPECT_TRUE(Inv.none());
129 EXPECT_TRUE(Inv.empty());
130
131 Vec.clear();
132 EXPECT_EQ(0U, Vec.count());
133 EXPECT_EQ(0U, Vec.size());
134 EXPECT_FALSE(Vec.any());
135 EXPECT_TRUE(Vec.none());
136 EXPECT_TRUE(Vec.empty());
137 }
138
139 }
0 //===- llvm/unittest/ADT/SmallBitVectorTest.cpp - SmallBitVector tests ----===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include "llvm/ADT/SmallBitVector.h"
10 #include "gtest/gtest.h"
11
12 using namespace llvm;
13
14 namespace {
15
16 TEST(SmallBitVectorTest, TrivialOperation) {
17 SmallBitVector Vec;
18 EXPECT_EQ(0U, Vec.count());
19 EXPECT_EQ(0U, Vec.size());
20 EXPECT_FALSE(Vec.any());
21 EXPECT_TRUE(Vec.none());
22 EXPECT_TRUE(Vec.empty());
23
24 Vec.resize(5, true);
25 EXPECT_EQ(5U, Vec.count());
26 EXPECT_EQ(5U, Vec.size());
27 EXPECT_TRUE(Vec.any());
28 EXPECT_FALSE(Vec.none());
29 EXPECT_FALSE(Vec.empty());
30
31 Vec.resize(11);
32 EXPECT_EQ(5U, Vec.count());
33 EXPECT_EQ(11U, Vec.size());
34 EXPECT_TRUE(Vec.any());
35 EXPECT_FALSE(Vec.none());
36 EXPECT_FALSE(Vec.empty());
37
38 SmallBitVector Inv = ~Vec;
39 EXPECT_EQ(6U, Inv.count());
40 EXPECT_EQ(11U, Inv.size());
41 EXPECT_TRUE(Inv.any());
42 EXPECT_FALSE(Inv.none());
43 EXPECT_FALSE(Inv.empty());
44
45 EXPECT_FALSE(Inv == Vec);
46 EXPECT_TRUE(Inv != Vec);
47 Vec = ~Vec;
48 EXPECT_TRUE(Inv == Vec);
49 EXPECT_FALSE(Inv != Vec);
50
51 // Add some "interesting" data to Vec.
52 Vec.resize(23, true);
53 Vec.resize(25, false);
54 Vec.resize(26, true);
55 Vec.resize(29, false);
56 Vec.resize(33, true);
57 Vec.resize(61, false);
58 unsigned Count = 0;
59 for (unsigned i = Vec.find_first(); i != -1u; i = Vec.find_next(i)) {
60 ++Count;
61 EXPECT_TRUE(Vec[i]);
62 EXPECT_TRUE(Vec.test(i));
63 }
64 EXPECT_EQ(Count, Vec.count());
65 EXPECT_EQ(Count, 23u);
66 EXPECT_FALSE(Vec[0]);
67 EXPECT_TRUE(Vec[32]);
68 EXPECT_FALSE(Vec[60]);
69
70 SmallBitVector Copy = Vec;
71 SmallBitVector Alt(3, false);
72 Alt.resize(6, true);
73 std::swap(Alt, Vec);
74 EXPECT_TRUE(Copy == Alt);
75 EXPECT_TRUE(Vec.size() == 6);
76 EXPECT_TRUE(Vec.count() == 3);
77 EXPECT_TRUE(Vec.find_first() == 3);
78 std::swap(Copy, Vec);
79
80 // Add some more "interesting" data.
81 Vec.resize(68, true);
82 Vec.resize(78, false);
83 Vec.resize(89, true);
84 Vec.resize(90, false);
85 Vec.resize(91, true);
86 Vec.resize(130, false);
87 Count = 0;
88 for (unsigned i = Vec.find_first(); i != -1u; i = Vec.find_next(i)) {
89 ++Count;
90 EXPECT_TRUE(Vec[i]);
91 EXPECT_TRUE(Vec.test(i));
92 }
93 EXPECT_EQ(Count, Vec.count());
94 EXPECT_EQ(Count, 42u);
95 EXPECT_FALSE(Vec[0]);
96 EXPECT_TRUE(Vec[32]);
97 EXPECT_FALSE(Vec[60]);
98 EXPECT_FALSE(Vec[129]);
99
100 Vec.flip(60);
101 EXPECT_TRUE(Vec[60]);
102 EXPECT_EQ(Count + 1, Vec.count());
103 Vec.flip(60);
104 EXPECT_FALSE(Vec[60]);
105 EXPECT_EQ(Count, Vec.count());
106
107 Vec.reset(32);
108 EXPECT_FALSE(Vec[32]);
109 EXPECT_EQ(Count - 1, Vec.count());
110 Vec.set(32);
111 EXPECT_TRUE(Vec[32]);
112 EXPECT_EQ(Count, Vec.count());
113
114 Vec.flip();
115 EXPECT_EQ(Vec.size() - Count, Vec.count());
116
117 Vec.reset();
118 EXPECT_EQ(0U, Vec.count());
119 EXPECT_EQ(130U, Vec.size());
120 EXPECT_FALSE(Vec.any());
121 EXPECT_TRUE(Vec.none());
122 EXPECT_FALSE(Vec.empty());
123
124 Inv = ~SmallBitVector();
125 EXPECT_EQ(0U, Inv.count());
126 EXPECT_EQ(0U, Inv.size());
127 EXPECT_FALSE(Inv.any());
128 EXPECT_TRUE(Inv.none());
129 EXPECT_TRUE(Inv.empty());
130
131 Vec.clear();
132 EXPECT_EQ(0U, Vec.count());
133 EXPECT_EQ(0U, Vec.size());
134 EXPECT_FALSE(Vec.any());
135 EXPECT_TRUE(Vec.none());
136 EXPECT_TRUE(Vec.empty());
137 }
138
139 }