Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
store-cast.hh
Go to the documentation of this file.
1#pragma once
3
5
6namespace nix {
7
15template<typename T>
16T & require(Store & store)
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:195
T & require(Store &store)
Definition store-cast.hh:16