aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/store-cast.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-03-26 21:12:25 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-03-31 23:01:40 -0400
commitabd5e7dec039386628223f886b33047734172c8d (patch)
treeca3aecd64e1e9375ab6ed48d4a7dc54ac83b584d /src/libstore/store-cast.hh
parent8ae9d669409851acb6de39335b11a95a991eae6d (diff)
Extend internal API docs, part 2
Picking up from #8111. Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
Diffstat (limited to 'src/libstore/store-cast.hh')
-rw-r--r--src/libstore/store-cast.hh7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libstore/store-cast.hh b/src/libstore/store-cast.hh
index ff62fc359..ccd19e5ad 100644
--- a/src/libstore/store-cast.hh
+++ b/src/libstore/store-cast.hh
@@ -4,6 +4,13 @@
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)
{