Skip to content

Commit 5acd272

Browse files
committed
Fix HashMap visualizers in Visual Studio (Code)
CDB doesn't care that you're using static_cast between unrelated types. VS(C) does. These should've been reinterpret_cast or C casts. Cast is from e.g. `u8*` to `tuple<$T1, $T2>*`
1 parent 81a769f commit 5acd272

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/etc/natvis/libstd.natvis

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<If Condition="(base.table.ctrl.pointer[i] &amp; 0x80) == 0">
4242
<!-- Bucket is populated -->
4343
<Exec>n--</Exec>
44-
<Item Name="{static_cast&lt;tuple&lt;$T1, $T2&gt;*&gt;(base.table.ctrl.pointer)[-(i + 1)].__0}">static_cast&lt;tuple&lt;$T1, $T2&gt;*&gt;(base.table.ctrl.pointer)[-(i + 1)].__1</Item>
44+
<Item Name="{((tuple&lt;$T1, $T2&gt;*)base.table.ctrl.pointer)[-(i + 1)].__0}">((tuple&lt;$T1, $T2&gt;*)base.table.ctrl.pointer)[-(i + 1)].__1</Item>
4545
</If>
4646
<Exec>i++</Exec>
4747
</Loop>
@@ -65,7 +65,7 @@
6565
<If Condition="(map.base.table.ctrl.pointer[i] &amp; 0x80) == 0">
6666
<!-- Bucket is populated -->
6767
<Exec>n--</Exec>
68-
<Item>static_cast&lt;$T1*&gt;(map.base.table.ctrl.pointer)[-(i + 1)]</Item>
68+
<Item>(($T1*)map.base.table.ctrl.pointer)[-(i + 1)]</Item>
6969
</If>
7070
<Exec>i++</Exec>
7171
</Loop>

0 commit comments

Comments
 (0)