forked from microsoft/GSL
Fix hash compilation issue for gsl::not_null with shared_ptr
Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com>
This commit is contained in:
co-authored by
carsonRadtke
parent
f883a665ee
commit
94759d5250
@@ -231,7 +231,7 @@ template <class T>
|
||||
not_null<T> operator+(std::ptrdiff_t, const not_null<T>&) = delete;
|
||||
|
||||
|
||||
template <class T, class U = decltype(std::declval<const T&>().get()), 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
|
||||
{
|
||||
std::size_t operator()(const T& value) const { return std::hash<U>{}(value.get()); }
|
||||
|
||||
Reference in New Issue
Block a user