mirror of
https://github.com/NixOS/nix.git
synced 2024-11-23 07:12:27 +00:00
Remove the visit
machinery in RealisedPath
In addition to being some ugly template trickery, it was also totally useless as it was used in only one place where I could replace it by just a few extra characters
This commit is contained in:
parent
d2091af231
commit
e69cfdebb0
@ -47,7 +47,7 @@ Realisation Realisation::fromJSON(
|
|||||||
}
|
}
|
||||||
|
|
||||||
StorePath RealisedPath::path() const {
|
StorePath RealisedPath::path() const {
|
||||||
return visit([](auto && arg) { return arg.getPath(); });
|
return std::visit([](auto && arg) { return arg.getPath(); }, raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RealisedPath::closure(
|
void RealisedPath::closure(
|
||||||
|
@ -58,19 +58,6 @@ struct RealisedPath {
|
|||||||
RealisedPath(StorePath path) : raw(OpaquePath{path}) {}
|
RealisedPath(StorePath path) : raw(OpaquePath{path}) {}
|
||||||
RealisedPath(Realisation r) : raw(r) {}
|
RealisedPath(Realisation r) : raw(r) {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Syntactic sugar to run `std::visit` on the raw value:
|
|
||||||
* path.visit(blah) == std::visit(blah, path.raw)
|
|
||||||
*/
|
|
||||||
template <class Visitor>
|
|
||||||
constexpr decltype(auto) visit(Visitor && vis) {
|
|
||||||
return std::visit(vis, raw);
|
|
||||||
}
|
|
||||||
template <class Visitor>
|
|
||||||
constexpr decltype(auto) visit(Visitor && vis) const {
|
|
||||||
return std::visit(vis, raw);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the raw store path associated to this
|
* Get the raw store path associated to this
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user