mhoopmann / mstoolkit

Automatically exported from code.google.com/p/mstoolkit
27 stars 10 forks source link

Using Namespace Std in Headers #17

Closed dbaileychess closed 6 years ago

dbaileychess commented 6 years ago

A few of the .h files in this repo have

using namespace std;

Which is generally a bad practice as it causes that namespace to be used in any including file. I would suggest explicitly using the namespace when needed, and remove the using namespace from header files.

mhoopmann commented 6 years ago

Hey Derek, No problem; was just being lazy. I might have some time to clean this up soon. But in case this is urgent, have you been using functions and values with std names (not bad practice, but perhaps not recommended)? Is there a conflict you need me to clean up ASAP?

dbaileychess commented 6 years ago

I was using Comet that references this package, and the C++/CLI layer had problems when trying to determine what array to use (cli::array or std::array). I fixed it in the Comet code by explicitly using the correct namespace.

So no, it isn't urgent, just wanted to give you a heads up.

mhoopmann commented 6 years ago

Good to hear it was fixed easily in your case. That is definitely a problem we want to avoid going forward with the next version of Comet. I should have it all squared away by then. Thanks for the notification.

mhoopmann commented 6 years ago

Should be fixed now. Namespaces are still in play, but locally rather than globally. Please let me know if you run into other problems. See you in November.

dbaileychess commented 6 years ago

looks good!