Visual Studio C++ Template IntelliSense Populates Based on Instantiations in Your Code

Nick Uhlenhuth

Ever since we announced Template IntelliSense, you all have given us great suggestions. One very popular suggestion was to have the Template Bar auto-populate candidates based on instantiations in your code. In Visual Studio 2019 version 16.1 Preview 2, we’ve added this functionality via an “Add All Existing Instantiations” option in the Template Bar dropdown menu. The following examples are from the SuperTux codebase. 

The Template Bar dropdown menu now contains a new entry, “Add All Existing Instantiations”.

 

 Clicking the “Add All Existing Instantiations” option will populate the dropdown, so you no longer need to manually type entries. 

 

Additionally, similar to Find All References, a window at the bottom of the editor shows you where each instantiation was found, and what its arguments were. 

  

Talk to Us! 

We hope this update addresses the popular customer feedback we received on Template IntelliSense! We’d love for you to download Visual Studio 2019 version 16.1 Preview 2 and let us know what you think. We can be reached via the comments below or via email (visualcpp@microsoft.com). If you encounter other problems with Visual Studio or have other suggestions you can use the Report a Problem tool in Visual Studio or head over to the Visual Studio Developer Community. You can also find us on Twitter (@VisualC). 

Posted in C++

2 comments

Discussion is closed. Login to edit/delete existing comments.

  • Piotr Maciejewski 0

    This is a great feature and I think it would be great to add next nice option. For example, if I have many templates with the same typename argument “T”: 
    template<typename T> struct A{};
    template<typename T> struct B{};
    template<typename T> struct C{};
    It would be useful to use something similar to “Add All Existing Instantiations” to assign the same type to all “typename T” occurrences. 
    Then with one click I could tell intellisense to assing for example uint32_t for all typename T. 

  • John Wellbelove 0

    Well, I’ve played around with this feature for a while, and I can honestly say I cannot for the life of me see what the point of it is!
    Thank God I can turn this annoyance off!

Feedback usabilla icon