aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-12 22:15:14 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-07-12 22:15:14 +0000
commitffc18583b1a086849ac0efd17da40ff510299b52 (patch)
treec480c8180d0ef2390c2a44d22c654394c5b518d5 /src/libstore
parent886c91dfcc462d157dc2ce5265800e98d1bc45dd (diff)
Move C++17 "pattern matching" boilerplat to utils.hh
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/content-address.cc4
-rw-r--r--src/libstore/derivations.cc4
-rw-r--r--src/libstore/store-api.cc4
3 files changed, 0 insertions, 12 deletions
diff --git a/src/libstore/content-address.cc b/src/libstore/content-address.cc
index 6cb69d0a9..f45f77d5c 100644
--- a/src/libstore/content-address.cc
+++ b/src/libstore/content-address.cc
@@ -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) {
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index d267468af..ce2025933 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -8,10 +8,6 @@
namespace nix {
-// FIXME Put this somewhere?
-template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
-template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
-
StorePath DerivationOutput::path(const Store & store, std::string_view drvName) const
{
return std::visit(overloaded {
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 8d46bb436..62514d3be 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -802,10 +802,6 @@ void ValidPathInfo::sign(const Store & store, const SecretKey & secretKey)
sigs.insert(secretKey.signDetached(fingerprint(store)));
}
-// FIXME Put this somewhere?
-template<class... Ts> struct overloaded : Ts... { using Ts::operator()...; };
-template<class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
-
bool ValidPathInfo::isContentAddressed(const Store & store) const
{
if (! ca) return false;