0
Why vector, variant and any are not keywords?
I was looking for the list of keywords in C++ in cppreference website which very famous for its c++ content and i saw that in that they didn't mention vector as keyword(vector is not present in that table) and including some other keywords such as variant, any, optional and thread. So why these are not keywords because we cannot use them as variable if we are using there library?
3 Respostas
+ 1
They are not keywords because they are not part of the core language. ( everything in C++ you can use without a header )
Vector, variant and any and the likes are implemented using the core language and are part of the standard library which comes with the language.
You can use them as variable names if you really want to, albeit not recommended.
0
Dennis You mean I can access all other 97 keywords without header files?
0
Abhishek Dimri yes