Is there any tool to convert:
#include <iostream>
using namespace std;
using namespace foo;
using namespace bar;
namespace foo
{
int foo_value() { return 5; }
}
namespace bar
{
const double bar_var = 3;
double bar_value() { return 2*bar_var; }
}
int main () {
cout << foo_value() << '\n';
cout << bar_var << '\n';
cout << bar_value() << '\n';
return 0;
}
to
#include <iostream>
namespace foo
{
int foo_value() { return 5; }
}
namespace bar
{
const double bar_var = 3;
double bar_value() { return 2*bar_value; }
}
int main () {
std::cout << foo::foo_value() << '\n';
std::cout << bar::bar_var << '\n';
std::cout << bar::bar_value() << '\n';
return 0;
}
I want to remove using namespace
and use the full name for the functions and variables for each namespace.
Visual Studio Intellisense has code completion and I wanted to see if it can automatically replace for example foo_value()
with foo::foo_value()
in the source code. If not, is there any tool with such capabilities? The provided example is just to explain the question. In fact, I have a project with multiple source/header files, which I would like to use the tool for.