Replies: 2 comments
-
That repros in VS 2022 as well. It's somewhat "by design", although you could file a feature request to filter out completion results in this case. A comment on a related completion filtering request is at https://developercommunity.visualstudio.com/t/C-IntelliSense-completion-list-for-C/10079651#T-N10094888 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks Sean I tried it on VS2022 as well after I started this discussion and also reproduced it there as well. I will file a feature request as it could be quite useful to only show functions that are callable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have just started using the enable_if and I am going to be using it for my vector types so that a 2D vector will have functions x() and y() to access the x and y elements and z() function if it's a 3D vector.
The templated Vector class takes an integer greater than 1 to use for std::array. Anyway, I can achieve this via std::enable_if and it works great, however one thing that's a little frustrating is the intellisense.
I have created a very simplified class to show the behaviour
Basically, fnA() is not supposed to exist for anything but doubles.
You can see on line 19 that it underlines with reg squiggles saying "no instance of function template "A::fnA [with T=int]" matches the argument list C/C++(304)"
The internal compiler I guess you could call it, recognises this as an error, however the choices I get for a on line 20 gives me fnA() as a possibility and I think something is going wrong.
I do not know if this is a bug or if the intellisense doesn't do too well with SFINAE type programming.
It would be nice to have intellisense show only valid functions. Is this possible? Or are there reasons against doing this.
Thanks
I guess I should add that I am using
Visual Studio Code 1.69.1
cpptools 1.10.8
intelliSenseMode is linux-gcc-x64
Also, Pre-Release cpptools 1.11.2 also shows the same issue
Beta Was this translation helpful? Give feedback.
All reactions