You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mbed.h has "using namespace std" and "using namespace mbed" . Just spent a bunch of time debugging something b/c I had no idea my namespace had gotten clobbered. Putting using declarations in a header file is forbidden in almost every text written about C++ style: https://stackoverflow.com/questions/5849457/using-namespace-in-c-headers
This is especially bad considering that you need to include "mbed.h" almost everywhere
You guys should refactor this out.
Or a simpler way out would be to deprecate "mbed.h", and make a "new_mbed.h" that has all the #includes, and mbed.h could look like this, for backwards compatibility:
#include "new_mbed.h"
using namespace mbed;
using namespace std;
[ ] Question
[ X ] Enhancement
[ ] Bug
The text was updated successfully, but these errors were encountered:
Description
mbed.h has "using namespace std" and "using namespace mbed" . Just spent a bunch of time debugging something b/c I had no idea my namespace had gotten clobbered. Putting using declarations in a header file is forbidden in almost every text written about C++ style:
https://stackoverflow.com/questions/5849457/using-namespace-in-c-headers
This is especially bad considering that you need to include "mbed.h" almost everywhere
You guys should refactor this out.
Or a simpler way out would be to deprecate "mbed.h", and make a "new_mbed.h" that has all the #includes, and mbed.h could look like this, for backwards compatibility:
#include "new_mbed.h"
using namespace mbed;
using namespace std;
[ ] Question
[ X ] Enhancement
[ ] Bug
The text was updated successfully, but these errors were encountered: