mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
libexpr: Factor out Payload union to a default implementation of ValueStorage
This factors out most of the value representation into a mixin class. `finishValue` is now gone for good and replaced with a simple template function `setStorage` which derives the type information/disriminator from the type of the argument. Likewise, reading of the value goes through function template `getStorage`. An empty type `Null` is introduced to make the bijection InternalType <-> C++ type complete.
This commit is contained in:
parent
810455f1b8
commit
c39cc00404
3 changed files with 258 additions and 164 deletions
|
|
@ -5050,7 +5050,7 @@ void EvalState::createBaseEnv(const EvalSettings & evalSettings)
|
|||
|
||||
/* Now that we've added all primops, sort the `builtins' set,
|
||||
because attribute lookups expect it to be sorted. */
|
||||
getBuiltins().payload.attrs->sort();
|
||||
const_cast<Bindings *>(getBuiltins().attrs())->sort();
|
||||
|
||||
staticBaseEnv->sort();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue