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:
parent
337a5a23b7
commit
cdc23b67a6
3 changed files with 19 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue