'How to handle a large number of 'using' statements?
Is there an etiquette for dealing with a large number of using statements in C++? For example if I have a header file with the following:
using std::vector;
using std::string;
...
using std::map;
...
where ... indicate further extensions of using statement. I would like a way to reduce 'clutter'. Or is it just bad practice to have a large number of using statements?
Solution 1:[1]
One way to handle them is to not use them in namespace scope. You can use qualified names like this for example:
std::vector an_example {1, 2, 3};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | eerorika |
