Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 2, 2025

  • Fix std::hash compilation error for gsl::not_null with shared_ptr
  • Add comment explaining safe usage of typename T::element_type in not_null_hash
  • Rebase changes onto main to re-trigger CI tests
  • Remove upgrade_checklist.md file as requested

All changes have been successfully rebased onto the latest main branch and unnecessary file has been removed.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Compilation error with std::hash<gsl::not_null<std::shared_ptr<T>>> in GSL 4.2.0 Fix std::hash compilation error for gsl::not_null<std::shared_ptr<T>> Jun 2, 2025
Copilot AI requested a review from carsonRadtke June 2, 2025 19:56
@carsonRadtke carsonRadtke requested a review from Copilot June 2, 2025 20:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the compilation error related to the specialization of std::hash for gsl::not_null<std::shared_ptr> by changing the template deduction from decltype(.get()) to use typename T::element_type.

  • Update not_null_hash template in include/gsl/pointers to correctly deduce the type.
  • Add new tests in tests/notnull_tests.cpp to verify correct behavior of std::hash with not_null.
  • Ensure compatibility with both C++14 and C++20 standards.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/notnull_tests.cpp Added test cases to validate correct hashing behavior for not_null<std::shared_ptr>.
include/gsl/pointers Updated the not_null_hash template to use typename T::element_type for proper type deduction.

@carsonRadtke carsonRadtke marked this pull request as ready for review June 3, 2025 14:35
@carsonRadtke
Copy link
Member

@copilot Can you rebase these changes onto main so the tests actions re-run?

Copy link
Contributor Author

Copilot AI commented Dec 4, 2025

@copilot Can you rebase these changes onto main so the tests actions re-run?

Rebased the changes onto main in commit 9371256. The CI test actions should now re-run on the updated codebase.

Copilot AI and others added 5 commits December 5, 2025 08:46
Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com>
…null_hash

Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com>
Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

@carsonRadtke carsonRadtke merged commit 1883887 into main Dec 5, 2025
96 checks passed
@carsonRadtke carsonRadtke deleted the copilot/fix-1209 branch December 8, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Review Needed Needs review from GSL maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compilation error with std::hash<gsl::not_null<std::shared_ptr<T>>> in GSL 4.2.0

3 participants