mirror of
https://github.com/microsoft/GSL
synced 2026-08-26 04:23:04 -04:00
Without this change, the guideline https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c89-make-a-hash-noexcept would be violated. The test fails before the changes here: ``` tests/pointers_tests.cpp:102:23: error: static assertion failed due to requirement 'noexcept(std::hash<gsl::not_null<std::shared_ptr<int>>>{}(std::declval()))': gsl::not_null hash operator must be noexcept 102 | static_assert(noexcept(std::hash<Key>{}(std::declval<Key>())), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tests/pointers_tests.cpp:108:23: error: static assertion failed due to requirement 'noexcept(std::hash<gsl::strict_not_null<std::shared_ptr<int>>>{}(std::declval()))': gsl::strict_not_null hash operator must be noexcept 108 | static_assert(noexcept(std::hash<Key>{}(std::declval<Key>())), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> |
||
|---|---|---|
| .. | ||
| algorithm_tests.cpp | ||
| assertion_tests.cpp | ||
| at_tests.cpp | ||
| byte_tests.cpp | ||
| CMakeLists.txt | ||
| CMakeLists.txt.in | ||
| constexpr_notnull_tests.cpp | ||
| deathTestCommon.h | ||
| no_exception_ensure_tests.cpp | ||
| notnull_tests.cpp | ||
| owner_tests.cpp | ||
| pointers_tests.cpp | ||
| span_compatibility_tests.cpp | ||
| span_ext_tests.cpp | ||
| span_tests.cpp | ||
| strict_notnull_tests.cpp | ||
| utils_tests.cpp | ||