trilinos / Trilinos

Primary repository for the Trilinos Project
https://trilinos.org/
Other
1.2k stars 563 forks source link

ROL: "using namespace std" anti-pattern #13532

Open rileyjmurray opened 6 days ago

rileyjmurray commented 6 days ago

There are a 15 files in ROL/src that use the "using namespace std" (anti-)pattern. I noticed this when compiling with clang 17. Image

My compiler mostly complained about unqualified use of std::forward in one file (ROL_VectorClone.hpp). But there might be other places where unqualified standard library functions are used.

Does anyone have objections to me removing the "using namespace std;" lines and making things explicit, as needed?

github-actions[bot] commented 6 days ago

Automatic mention of @aj463

ccober6 commented 6 days ago

@trilinos/rol

gregvw commented 6 days ago

I will take care of these

gregvw commented 5 days ago

These are have all been fixed in the ROL development branch so it's just a matter of merging to Trilinos.

I wrote a clang-tidy check that can either automatically replace using namespace foo with using foo::bar in the same location for every bar symbol used or alternatively prepend all of the symbols with the appropriate foo:: namespace qualifier if that is of any interest.