Smarter Member List Filtering for C++
We are always looking for ways to make you more productive while coding in Visual Studio. In Visual Studio 2019 version 16.2, we have created a smarter, more relevant Member List. Specifically, we now apply method filtering based on type qualifiers. To illustrate this, consider the following example:
You have two vectors, but one is
const. When we invoke the member list on the non-const vector, we see the option for
push_back. However, when we invoke the member list on the const vector, Visual Studio now knows not to display any non-const members on a const object:
Even More Filtering
If you wish to benefit further from Member List and completion filtering, try out Predictive IntelliSense. As an experimental feature, Predictive IntelliSense is disabled by default, but can be enabled under Tools > Options > Text Editor > C/C++ > Experimental. Or simply type “predictive” in the (Ctrl + Q) Search Bar. Currently, Predictive IntelliSense filters by type when you’re in an argument or assignment position. In the example below,
i is of type
int, so Predictive IntelliSense only shows
int items in the completion list.
Note: If you ever wish to un–filter the completion list, just click the green “+” symbol in the bottom left of the list.
Talk to Us!
If you have feedback on Member List filtering in Visual Studio, we would love to hear from you. We can be reached via the comments below or via email (email@example.com). If you encounter other problems with Visual Studio or MSVC or have a suggestion, you can use the Report a Problem tool in Visual Studio or head over to Visual Studio Developer Community. You can also find us on Twitter @VisualC and follow me @nickuhlenhuth.