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

std::hash<Rcpp::String>. close #84 #408

Merged
merged 1 commit into from Dec 12, 2015

Conversation

@thirdwing
Copy link
Member

commented Dec 12, 2015

std::hash<Rcpp::String> to close #84

Qiang Kou
@eddelbuettel

This comment has been minimized.

Copy link
Member

commented Dec 12, 2015

Nicely done! That looks like a clean addition to me so 👍 from here. Anybody else?

@kevinushey

This comment has been minimized.

Copy link
Contributor

commented Dec 12, 2015

👍 ! Thanks for implementing this.

@kevinushey

This comment has been minimized.

Copy link

commented on inst/include/Rcpp/String.h in f7686af Dec 12, 2015

Does using hash<const char*> work here? Since we're returning a C string already, it would be nice to avoid a std::string round trip.

EDIT: It looks like such a specialization is not provided as it would break generic hashing of pointer types, so going through string is probably the right thing. (http://en.cppreference.com/w/cpp/utility/hash)

eddelbuettel added a commit that referenced this pull request Dec 12, 2015
std::hash<Rcpp::String>. close #84
@eddelbuettel eddelbuettel merged commit 0c598bc into RcppCore:master Dec 12, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
eddelbuettel added a commit that referenced this pull request Dec 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.