I'm trying to use two very large C++ libraries to write my own library and application set and there are using directives present in the main header classes of both libraries. The conflict lies in a single class, called vector (with the std::vector). One header has "using namespace std", and this messes things up.
Is there a way to exclude the identifier from the namespace, after the "using namespace" has already been written?
Is there a way to get the worms back into the can?
No.
The best option is to fix the header with the using directive. Remove it and add the required std:: prefixes to the declarations.
There's no way to un-using in C++. In this case the only options I can think of are:
Have the library writers fix their library. using in a header is absolutely a bug in the library that should be fixed.
Completely isolate the two libraries from each other within your application by using separate, completely compartmentalized implementation files. If the two libraries would need to communicate you'd have to create some sort of mediator in your code to glue them together.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With