Did you include the header files? For example, if you want to use std::string, then add the #include <string> directive.
Which kind of project and code did you try?
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am using windows 10 VS community 19, how do I autocomplete std:: please? I have installed intellisense and intellicode. Also intellicode doesn't show any starred words at top of a list. I have enabled c++ base model, but otherwise there was nothing, I even googled it and what they had there - I didn't...
Did you include the header files? For example, if you want to use std::string, then add the #include <string> directive.
Which kind of project and code did you try?
Console. I want it use for cout and cin, endl mostly for now. So when I write like: cout, it would autocomplete to std::cout. Because include namespaces std; is a bad practice I read.
Hi empleat,
As far as I know, we cannot autocomplete namespace through function name in c++ editor.
After some tests, I found code snippet, maybe it can meet your requirement:
.snippet
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\Snippets\1033\Visual C++
std::
into editorIf the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our *
*documentation* to enable e-mail notifications if you want to receive the related email notification for this thread.**
You kidding right, couldn't you just copy paste them, instead of making a picture?
It is kinda weird, someone had to ask already this question. VS is like most complex IDE no, strange that there would be nothing better!
Isn't there like some addon which could do this BTW?
Also what if there was like variable named s, or something and I would want to do a indentation?
I found easy solution as I Am learning: https://www.learncpp.com/cpp-tutorial/using-declarations-and-using-directives/
Apparently using std::cout; saves you from writing std:: each time and it is generally considered safe.
How the hell no one told me that?!
And as we all know - using namespace std:: is a bad idea, because if something changes in future C++ versions etc. it can easily mess a whole program!