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

Remove endpoint_hash from std namespace #1460

Merged

Conversation

Projects
3 participants
@wezrule
Copy link
Collaborator

commented Dec 15, 2018

From https://en.cppreference.com/w/cpp/language/extending_std:

It is undefined behavior to add declarations or definitions to namespace std or to any namespace nested within std, with a few exceptions

A struct template endpoint_hash and full explicit specializations were defined within the std namespace; I have moved them out. As they are only used within this file I have wrapped them in an unnamed namespace and moved the existing endpoint_hash_raw & ip_address_hash_raw static functions into that as well; using static for internal linkage should be avoided (see More Effective C++ Item 31).

@clemahieu clemahieu merged commit cab2eb8 into nanocurrency:master Dec 15, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@rkeene rkeene added the bug label Dec 16, 2018

@rkeene rkeene added this to the V18.0 milestone Dec 16, 2018

@wezrule wezrule deleted the wezrule:remove_undefined_std_extensions branch Dec 16, 2018

@zhyatt zhyatt added this to Unscheduled in V18 Dec 27, 2018

@zhyatt zhyatt moved this from Unscheduled to CP 0 in V18 Jan 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.