What’s the recommended practice regarding the using declaration (e.g using std::vector;)?
Should it be at the top of the cpp/cc file or just in the scope where it’s being used?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For readability its better to have it at the beginning.
Otherwise, use it in the smallest scope possible.
To make the code clearer to other, you should avoid using
using.update:
Please take mezhaka’s comment into account. I wasn’t precise enough, but referred with “at the beginning” to the beginning of the “real” code, i.e. after the
#includes‘s