mirror of
https://github.com/NixOS/nix.git
synced 2025-12-15 05:21:03 +01:00
Move C++17 "pattern matching" boilerplat to utils.hh
This commit is contained in:
parent
886c91dfcc
commit
ffc18583b1
4 changed files with 5 additions and 12 deletions
|
|
@ -24,10 +24,6 @@ std::string makeFixedOutputCA(FileIngestionMethod method, const Hash & hash)
|
|||
+ hash.to_string(Base32, true);
|
||||
}
|
||||
|
||||
// FIXME Put this somewhere?
|
||||
template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
|
||||
template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
|
||||
|
||||
std::string renderContentAddress(ContentAddress ca) {
|
||||
return std::visit(overloaded {
|
||||
[](TextHash th) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue