Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs in SparseMatrix C++11 checks for map selection #43

Closed
mneilly opened this issue May 20, 2016 · 1 comment
Closed

Bugs in SparseMatrix C++11 checks for map selection #43

mneilly opened this issue May 20, 2016 · 1 comment
Projects

Comments

@mneilly
Copy link
Contributor

mneilly commented May 20, 2016

SparseMatrix.hpp contains two bugs in the following C++ version check as of commit 299047b:

#if __cplusplus <= 201103L
// for C++03
#include <map>
typedef std::map< global_int_t, local_int_t > GlobalToLocalMap;
#else
// for C++11 or greater
#include <unordered_map>
using GlobalToLocalMap = std::unorderd_map< global_int_t, local_int_t >;
#endif

The check of __cplusplus performs a less than or equal check which should be a less than check. As it is written passing -std=c++11 to g++ causes the "// for C++03" code to be used.

In the "// for C++11 or greater" code, std::unordered_map is incorrectly spelled as std::unorderd_map. It is missing the e between the r and d.

@luszczek
Copy link
Collaborator

Fixed in 002fc8c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants