1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 19:01:16 +02:00

Provide std::hash<SourcePath>

This commit is contained in:
Eelco Dolstra 2024-06-06 19:12:36 +02:00
parent 337a5a23b7
commit cdc23b67a6
3 changed files with 19 additions and 8 deletions

View file

@ -115,8 +115,19 @@ struct SourcePath
{
return {accessor, accessor->resolveSymlinks(path, mode)};
}
friend class std::hash<nix::SourcePath>;
};
std::ostream & operator << (std::ostream & str, const SourcePath & path);
}
template<>
struct std::hash<nix::SourcePath>
{
std::size_t operator()(const nix::SourcePath & s) const noexcept
{
return std::hash<decltype(s.path)>{}(s.path);
}
};