Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all "using namespace std" #201

Closed
SanPen opened this issue Jan 4, 2023 · 5 comments · Fixed by #234
Closed

Remove all "using namespace std" #201

SanPen opened this issue Jan 4, 2023 · 5 comments · Fixed by #234

Comments

@SanPen
Copy link

SanPen commented Jan 4, 2023

Hi,

I had an error due to the usage of using namespace std; in several files of the project:

See the error at S.O.

It would be a good idea to remove those.

@SanPen SanPen changed the title Remove global using namespace std; Remove all "using namespace std" Jan 4, 2023
@StefanBruens
Copy link

I can´t find any using namespace std; in any of the header files.

The problem you see is not an ambiguity between std::malloc and ::malloc, but with arma::superlu::malloc, which has been imported into the global namespace.

I think this Issue is invalid.

@SanPen
Copy link
Author

SanPen commented Jan 27, 2023

Well, maybe we downloaded sifferent versions for some reason.
But In the code I downloaded it definitelly was there since I had to fix it myself.
So if this was fixed, then great.

PD: maybe it is not in the header files, but the CPP files. I was compiling everything in the same project.

@havardAasen
Copy link

Running the command

grep -rwn "using namespace std"

I got one hit in stable/2.11

CoinUtils/src/CoinLpIO.cpp:31:using namespace std;

for master I got 5 hits

src/CoinAdjacencyVector.cpp:35:using namespace std;
src/CoinStaticConflictGraph.cpp:29:using namespace std;
src/CoinConflictGraph.cpp:33:using namespace std;
src/CoinLpIO.cpp:30:using namespace std;
src/CoinDynamicConflictGraph.cpp:104:using namespace std;

@tkralphs
Copy link
Member

tkralphs commented Apr 8, 2024

I removed the instance in stable/2.11 in 7c4a14c before making release 2.11.11. It was actually superfluous, so it wouldn't have caused issues, but better to get rid of it.

@tkralphs
Copy link
Member

tkralphs commented Apr 8, 2024

We should still remove the ones in master, but those might require a bit more care.

a-andre added a commit to a-andre/CoinUtils that referenced this issue Jul 31, 2024
svigerske pushed a commit that referenced this issue Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants