Skip to content

Replace deprecated __gnu_cxx::hash_map with std::unordered_map - #33

Open
jamesjer wants to merge 1 commit into
cvc5:masterfrom
jamesjer:master
Open

Replace deprecated __gnu_cxx::hash_map with std::unordered_map#33
jamesjer wants to merge 1 commit into
cvc5:masterfrom
jamesjer:master

Conversation

@jamesjer

@jamesjer jamesjer commented Mar 5, 2020

Copy link
Copy Markdown

Additionally remove -Wno-deprecated, since hash_map is the only deprecated interface currently in use. Note that std::unordered_map is part of the C++11 standard, and CMakeLists.txt already requires a C++11 compiler.

@4tXJ7f 4tXJ7f left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. I have some minor requests.

Comment thread CMakeLists.txt
endif()

add_cxx_flag("-Wall")
add_cxx_flag("-Wno-deprecated")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather keep -Wno-deprecated to prevent people from re-introducing deprecated functions/classes.

Comment thread src/check.h
#include <hash_map>
#else
#include <ext/hash_map>
#include <unordered_map>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eliminate _MSC_VER case (hash_map is deprecated).

Comment thread src/check.h
typedef __gnu_cxx::hash_map<std::string, SymExpr *> symmap2;
typedef std::unordered_map<std::string, Expr *> symmap;
typedef std::unordered_map<std::string, SymExpr *> symmap2;
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eliminate _MSC_VER case.

@4tXJ7f

4tXJ7f commented Mar 9, 2020

Copy link
Copy Markdown
Member

Also, since you are an external contributor, it would be great if you could sign the commit as outlined here to indicate that the DCO applies to your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants