Browse Source

natvis: meta context

Michele Caini 2 years ago
parent
commit
698866df76
1 changed files with 17 additions and 0 deletions
  1. 17 0
      natvis/entt/meta.natvis

+ 17 - 0
natvis/entt/meta.natvis

@@ -135,4 +135,21 @@
 			<Item Name="[context]" Condition="ctx != nullptr">ctx->value</Item>
 		</Expand>
 	</Type>
+	<Type Name="entt::meta_ctx">
+		<Intrinsic Name="element_at" Expression="value.packed.first_base::value[pos].element">
+			<Parameter Name="pos" Type="int"/>
+		</Intrinsic>
+		<DisplayString>{ value }</DisplayString>
+		<Expand>
+			<CustomListItems>
+				<Variable Name="pos" InitialValue="0"/>
+				<Variable Name="last" InitialValue="value.size()"/>
+				<Loop>
+					<Break Condition="pos == last"/>
+					<Item Name="[{ element_at(pos).first }]">element_at(pos).second</Item>
+					<Exec>++pos</Exec>
+				</Loop>
+			</CustomListItems>
+		</Expand>
+	</Type>
 </AutoVisualizer>