visual-c++natvis

How to display template parameter type name in natvis?


I want to extend a natvis visualizer for a (C++) template class. Is there a way to display a type name of the first template parameter?

It would be great for boost::variant<int,bool> v; v=1; to display 1 (int) or something like that


Solution

  • If you want to show $T1 as a string, wrap it with ". For example, for

    <DisplayString>{*($T1*)storage_.data_.buf} {"$T1"}</DisplayString>

    in your case you will see 1 "int"