File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -183,6 +183,8 @@ template <typename T, size_t MinInlineCapacity>
183183class svector {
184184 static_assert (MinInlineCapacity <= 127 , " sorry, can't have more than 127 direct elements" );
185185 static constexpr auto N = detail::automatic_capacity<T>(MinInlineCapacity);
186+ static constexpr auto alignment_of_t = std::alignment_of_v<T>;
187+ static constexpr auto offset_to_indirect_data = detail::round_up(sizeof (detail::header), alignment_of_t );
186188
187189 enum class direction { direct, indirect };
188190
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <AutoVisualizer xmlns =" http://schemas.microsoft.com/vstudio/debugger/natvis/2010" >
3+ <Type Name =" ankerl::v1_0_3::svector< *> " >
4+ <DisplayString >svector</DisplayString >
5+ <Expand >
6+ <!-- <Synthetic Name="mode" Condition="(m_data[0] & 1) == 1">
7+ <DisplayString>direct mode</DisplayString>
8+ </Synthetic>-->
9+ <Item Name =" size" Condition =" (m_data[0] & 1) == 1" >m_data[0] >> 1</Item >
10+ <ArrayItems Condition =" (m_data[0] & 1) == 1" >
11+ <Size >m_data[0] >> 1</Size >
12+ <ValuePointer >(value_type*)((char*)& m_data + alignment_of_t)</ValuePointer >
13+ </ArrayItems >
14+ <!-- <Synthetic Name="mode" Condition="(m_data[0] & 1) == 0">
15+ <DisplayString>indirect mode</DisplayString>
16+ </Synthetic>-->
17+ <Item Name =" size" Condition =" (m_data[0] & 1) == 0" >(*(detail::header**)& m_data)->m_size</Item >
18+ <ArrayItems Condition =" (m_data[0] & 1) == 0" >
19+ <Size >(*(detail::header**)& m_data)->m_size</Size >
20+ <ValuePointer >(value_type*)((char*)(*(detail::header**)& m_data) + offset_to_indirect_data)</ValuePointer >
21+ </ArrayItems >
22+ </Expand >
23+ </Type >
24+ </AutoVisualizer >
You can’t perform that action at this time.
0 commit comments