This is an archive of the discontinued LLVM Phabricator instance.

Implement P0599 - noexcept for hash functions
ClosedPublic

Authored by mclow.lists on Mar 21 2017, 10:38 PM.

Details

Reviewers
EricWF
Summary

Mark most of the hash functions provided by libc++ as noexcept; the exceptions being optional and variant.
Tests to ensure this.

There's still some investigation to be done on unique_ptr and fancy pointer support, but that can come later.

Diff Detail

Event Timeline

mclow.lists created this revision.Mar 21 2017, 10:38 PM

Add missing include to the thread::id test and mark unique_ptrs hash as not noexcept.

EricWF accepted this revision.Mar 22 2017, 5:38 PM

LGTM. Although it would be useful to test that hash<variant<...>> and hash<optional<T>> do not have noexcept call operators.

Alternatively should we make hash conditionally noexcept for variant and optional?

This revision is now accepted and ready to land.Mar 22 2017, 5:38 PM
mclow.lists closed this revision.Mar 22 2017, 7:52 PM

Committed as revision 298573