fix typo in `StringType::cmpStatic`
Motivation and Context
A typo in StringType.cpp causes a logical error in StringType::cmpStatic
Approach
Fix the typo, remove the using namespace std directive. See the commit messages for more detail, included below
-
StringType.cpp: remove
using namespace stddirectiveAs demonstrated in the previous commit, and as a general principle, the
using namespace stddirective can lead to surprising results and is not generally recommended.Remove it to avoid further similar bugs in the future.
-
StringType::cmpStatic: fix accidental reference to std::right
Because of the
using namespace stddirective at the top of StringType.cpp, withinStringType::cmpStatic,rightis resolved to the functionstd::right, from the<ios>header, included indirectly by<iostream>.std::right, a function, is always non-null. The intention here was clearly to use the parameterright_data, notstd::right.Fix that bug.
How Has This Been Tested?
Not tested.
Screenshots or console output (if appropriate)
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.