@@ -37,7 +37,9 @@ struct Struct32B {
37
37
#pragma GCC diagnostic pop
38
38
#endif
39
39
}
40
-
40
+ static_assert (sizeof (SmallVector<void *, 0 >) ==
41
+ sizeof(unsigned ) * 2 + sizeof(void *),
42
+ "wasted space in SmallVector size 0");
41
43
static_assert (alignof(SmallVector<Struct16B, 0 >) >= alignof(Struct16B),
42
44
"wrong alignment for 16-byte aligned T");
43
45
static_assert (alignof(SmallVector<Struct32B, 0 >) >= alignof(Struct32B),
@@ -46,19 +48,13 @@ static_assert(sizeof(SmallVector<Struct16B, 0>) >= alignof(Struct16B),
46
48
"missing padding for 16-byte aligned T");
47
49
static_assert (sizeof (SmallVector<Struct32B, 0 >) >= alignof(Struct32B),
48
50
"missing padding for 32-byte aligned T");
49
-
50
- static_assert (sizeof (SmallVector<void *, 0 >) ==
51
- sizeof(unsigned ) * 2 + sizeof(void *),
52
- "wasted space in SmallVector size 0");
53
51
static_assert (sizeof (SmallVector<void *, 1 >) ==
54
52
sizeof(unsigned ) * 2 + sizeof(void *) * 2,
55
53
"wasted space in SmallVector size 1");
54
+
56
55
static_assert (sizeof (SmallVector<char , 0 >) ==
57
56
sizeof(void *) * 2 + sizeof(void *),
58
57
"1 byte elements have word-sized type for size and capacity");
59
- static_assert (sizeof (SmallVector<int16_t , 0 >) ==
60
- sizeof(unsigned ) * 2 + sizeof(void *),
61
- "2 byte elements have 32-bit type for size and capacity");
62
58
63
59
// / Report that MinSize doesn't fit into this vector's size type. Throws
64
60
// / std::length_error or calls report_fatal_error.
0 commit comments