Lux-AI-Challenge / Lux-Design-S1

Home to the design and engine of the @Lux-AI-Challenge Season 1, hosted on @kaggle
https://lux-ai.org/
Apache License 2.0
897 stars 151 forks source link

Don't `using namespace std;` at global scope in headers #55

Closed lufsc closed 3 years ago

lufsc commented 3 years ago

While using namespace std; may have some benefits, it has some downsides too. Therefore the decision whether or not to use the namespace should be left to the person writing the bot. However, when you put using namespace std; in a header at global scope, that means that you make that decision for the user of the library, as they can't remove this statement.

The fix for this would be to move the using namespace std; into the kit namespace, so this

using namespace std;
namespace kit {
    // ...
}

would become this

namespace kit {
    using namespace std;

    // ...
}

This would be a breaking change though, but given that it's quite early in the competition, I think this is acceptable.

StoneT2000 commented 3 years ago

good catch. we will merge this in in the next release and update the kits!

StoneT2000 commented 3 years ago

to be merged in #51