Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
memo.hh File Reference
#include "nix/util/fun.hh"
#include <memory>
#include <mutex>
#include <optional>

Go to the source code of this file.

Functions

template<typename T>
fun< T()> nix::memo (fun< T()> f)

Function Documentation

◆ memo()

template<typename T>
fun< T()> nix::memo ( fun< T()> f)

Memoize a fun<T()>.

Copies of the returned fun share the same cache. Thread-safe.