Remove “using namespace std” directive

• May 1, 2020 - 01:41
Reported version
3.x-dev
Type
Development
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

The file thirdparty\intervaltree\IntervalTree.h contains a using namespace std directive.

Since this file is included in a lot of places, it ends up polluting the global namespace of a large amount of code across both the libmscore and the mscoreapp projects. This namespace pollution has resulted in the recurring problem of std:: prefixes being missing in pull requests. Many of these omissions have slipped through the code review process and are now in committed code. As of this writing there are several dozen instances of this in the codebase.

The using namespace std directive should be removed, and the missing std:: prefixes should be added wherever needed.


Comments

Status PR created fixed

Fixed in branch master, commit 5a5857f63b

_Fix #304725: Remove “using namespace std” directive

Removed a “using namespace std” directive from the file “thirdparty\intervaltree\IntervalTree.h” and added missing “std::” prefixes wherever needed._

Fix version
3.5.0