I'm new to C++
and had a background in C
. The one thing which is quite difficult for me to adopt is to frequently use scope operator e.g. std::
Well, i'd avoid it usage by putting using namespace std
at the start of my source code but a lot of people doesn't use this method as they think this may bite them in future.
Plus, the visual-studio
also shows error/warning messages along scope operator e.g.
cannot convert from 'std::vector<int,std::allocator<_Ty>> *' to 'std::shared_ptr<std::vector<int,std::allocator<_Ty>>>'
Though the above message is verbose but its such a pain to read it (?). I think it can be simple to read if it was in this form
cannot convert from 'vector<int,allocator<_Ty>> *' to 'shared_ptr<vector<int,allocator<_Ty>>>'
1) Why everyone is using std::
, even for cout
, cin
, endl
? Why would anyone use the labels for some other purpose anyways?
2) Is their a workaround in Visual studio to not show me error/messages/syntax-highlights with a prefix std::
?