aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/store-cast.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/store-cast.hh')
-rw-r--r--src/libstore/store-cast.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstore/store-cast.hh b/src/libstore/store-cast.hh
index ff62fc359..2473e72c5 100644
--- a/src/libstore/store-cast.hh
+++ b/src/libstore/store-cast.hh
@@ -1,9 +1,17 @@
#pragma once
+///@file
#include "store-api.hh"
namespace nix {
+/**
+ * Helper to try downcasting a Store with a nice method if it fails.
+ *
+ * This is basically an alternative to the user-facing part of
+ * Store::unsupported that allows us to still have a nice message but
+ * better interface design.
+ */
template<typename T>
T & require(Store & store)
{