Skip to content

Commit 87b3085

Browse files
CopilotcarsonRadtke
andcommitted
Add comment explaining safe usage of typename T::element_type in not_null_hash
Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com>
1 parent 94759d5 commit 87b3085

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

include/gsl/pointers

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ template <class T>
231231
not_null<T> operator+(std::ptrdiff_t, const not_null<T>&) = delete;
232232

233233

234+
// T is conceptually a pointer so we don't have to worry about it being a reference and violating std::hash requirements
234235
template <class T, class U = typename T::element_type, bool = std::is_default_constructible<std::hash<U>>::value>
235236
struct not_null_hash
236237
{

0 commit comments

Comments
 (0)