Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
store-cast.hh
Go to the documentation of this file.
1#pragma once
3
4#include "store-api.hh"
5
6namespace nix {
7
15template<typename T>
17{
18 auto * castedStore = dynamic_cast<T *>(&store);
19 if (!castedStore)
20 throw UsageError("%s not supported by store '%s'", T::operationName, store.getUri());
21 return *castedStore;
22}
23
24}
Definition store-api.hh:169
ChunkedVector< std::string, 8192 > store
Definition lexer.l:1011
T & require(Store &store)
Definition store-cast.hh:16