commit | 1e36db9695a85a442fda69dd9d27aca4187b5ca7 | [log] [tgz] |
---|---|---|
author | Neil MacIntosh <neilmac@microsoft.com> | Mon Oct 19 13:20:53 2015 -0700 |
committer | Neil MacIntosh <neilmac@microsoft.com> | Mon Oct 19 13:20:53 2015 -0700 |
tree | dbaf52e97454eac427c61458c3dae75b1cbd2857 | |
parent | a813d9e58acc7476245be13f121955357de8ca52 [diff] | |
parent | 8e2acc9c901c658cfcce013ecaf594b9565b2fdb [diff] |
Merge pull request #147 from samuel3/master std::hash support for gsl::not_null.
diff --git a/include/gsl.h b/include/gsl.h index 519682b..ec75723 100644 --- a/include/gsl.h +++ b/include/gsl.h
@@ -197,6 +197,19 @@ } // namespace gsl +namespace std +{ + template<class T> + struct hash<gsl::not_null<T>> + { + size_t operator()(const gsl::not_null<T> & value) const + { + return hash<T>{}(value); + } + }; + +} // namespace std + #ifdef _MSC_VER #undef constexpr