mirror of
https://github.com/microsoft/GSL.git
synced 2025-09-25 22:51:33 +02:00
Add comment explaining safe usage of typename T::element_type in not_null_hash
Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com>
This commit is contained in:
@@ -231,6 +231,7 @@ template <class T>
|
|||||||
not_null<T> operator+(std::ptrdiff_t, const not_null<T>&) = delete;
|
not_null<T> operator+(std::ptrdiff_t, const not_null<T>&) = delete;
|
||||||
|
|
||||||
|
|
||||||
|
// T is conceptually a pointer so we don't have to worry about it being a reference and violating std::hash requirements
|
||||||
template <class T, class U = typename T::element_type, bool = std::is_default_constructible<std::hash<U>>::value>
|
template <class T, class U = typename T::element_type, bool = std::is_default_constructible<std::hash<U>>::value>
|
||||||
struct not_null_hash
|
struct not_null_hash
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user