Just like using namespace std; or using std::cout;, you should you use using enum EnumWithALongName; in a (very) limited scope to avoid conflicts.
From my experience, if everything function / type / constant is in a namespace, has a descriptive name, and you avoid wide scopes, you will almost run into troubles.
And I assume the C++ committee as the same point view since they added using enum xxx to C++20 ;)
Yes, it has occurred to me to use one function by mistake, imagining it to be another. The result was a code that behaved very strangely and I only noticed that it used the wrong function much later after spending a long time fighting with gdb. Since then I use this extensively and avoid using.
Just like
using namespace std;
orusing std::cout;
, you should you useusing enum EnumWithALongName;
in a (very) limited scope to avoid conflicts.From my experience, if everything function / type / constant is in a namespace, has a descriptive name, and you avoid wide scopes, you will almost run into troubles.
And I assume the C++ committee as the same point view since they added
using enum xxx
to C++20 ;)Have you experienced some issues?
Yes, it has occurred to me to use one function by mistake, imagining it to be another. The result was a code that behaved very strangely and I only noticed that it used the wrong function much later after spending a long time fighting with gdb. Since then I use this extensively and avoid using.
I understand your pain...