From a544ada8fe998bc7c47be942008430a7ec8366da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Garc=C3=ADa=20Salas?= Date: Sat, 17 Oct 2015 08:53:58 +0200 Subject: [PATCH 1/2] std::hash support for gsl::not_null. --- include/gsl.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/gsl.h b/include/gsl.h index 519682b..ca37848 100644 --- a/include/gsl.h +++ b/include/gsl.h @@ -197,6 +197,19 @@ private: } // namespace gsl +namespace std +{ + template + struct hash> + { + size_t operator()(const gsl::not_null & value) const + { + return hash{}(value); + } + }; + +} // namespace std + #ifdef _MSC_VER #undef constexpr From 8e2acc9c901c658cfcce013ecaf594b9565b2fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Garc=C3=ADa=20Salas?= Date: Sat, 17 Oct 2015 09:28:05 +0200 Subject: [PATCH 2/2] std::hash support for gsl::not_null. --- include/gsl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/gsl.h b/include/gsl.h index ca37848..ec75723 100644 --- a/include/gsl.h +++ b/include/gsl.h @@ -200,11 +200,11 @@ private: namespace std { template - struct hash> + struct hash> { - size_t operator()(const gsl::not_null & value) const + size_t operator()(const gsl::not_null & value) const { - return hash{}(value); + return hash{}(value); } };