blob: 26465bf6a8d3bf6bd75bbb095d4cd9cd484fbacc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#ifndef INCLUDED_SRC_BUILDTOOL_BUILD_ENGINE_BASE_MAPS_MODULE_NAME_HPP
#define INCLUDED_SRC_BUILDTOOL_BUILD_ENGINE_BASE_MAPS_MODULE_NAME_HPP
#include "src/utils/cpp/hash_combine.hpp"
namespace BuildMaps::Base {
struct ModuleName {
std::string repository{};
std::string module{};
ModuleName(std::string repository, std::string module)
: repository{std::move(repository)}, module{std::move(module)} {}
[[nodiscard]] auto operator==(ModuleName const& other) const noexcept
-> bool {
return module == other.module && repository == other.repository;
}
};
} // namespace BuildMaps::Base
namespace std {
template <>
struct hash<BuildMaps::Base::ModuleName> {
[[nodiscard]] auto operator()(
const BuildMaps::Base::ModuleName& t) const noexcept -> std::size_t {
size_t seed{};
hash_combine<std::string>(&seed, t.repository);
hash_combine<std::string>(&seed, t.module);
return seed;
}
};
} // namespace std
#endif
|