Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.natvis - how to reference a template template parameter?

I'm trying to create a .natvis file for visual studio. According to this page I can reference a template parameter with $T1, $T2 and so on. So in the case of MyClass<A> $T1 will reference the type A. This works. But in my case A is a template itself and I need to reference its parameter, some sort of $T1<$T1> - but this obviously doesn't work.

like image 453
nikitablack Avatar asked Apr 13 '17 08:04

nikitablack


1 Answers

With Visual Studio 2015 at least, the template parameter psuedo-variables $T1, $T2, etc. appear to actually correspond to the wildcards in the type `name' expression, rather than strictly to template parameters.

For example, when

<Type Name="outer&lt;*,inner&lt;*&gt;,*&gt">

matches against outer< int, inner< float >, short, long >, $T1 expands to int, $T2 expands to float and $T3 expands to short, long.

like image 196
Mad Alex Avatar answered Oct 05 '22 02:10

Mad Alex