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:
copilot-swe-agent[bot]
2025-07-26 03:12:56 +00:00
parent 94759d5250
commit 87b3085f6e

View File

@@ -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
{ {