Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
derived-path-map.hh
Go to the documentation of this file.
1#pragma once
3
4#include "nix/util/types.hh"
6
7namespace nix {
8
30template<typename V>
32{
36 struct ChildNode
37 {
44
48 using Map = std::map<OutputName, ChildNode>;
49
54
55 bool operator==(const ChildNode &) const noexcept;
56
57 // TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
58 // decltype(std::declval<V>() <=> std::declval<V>())
59 // operator <=> (const ChildNode &) const noexcept;
60 };
61
65 using Map = std::map<StorePath, ChildNode>;
66
71
72 bool operator==(const DerivedPathMap &) const = default;
73
74 // TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
75 // auto operator <=> (const DerivedPathMap &) const noexcept;
76
85
96
108 void removeSlot(const SingleDerivedPath & k, fun<bool(ChildNode &)> callback);
109};
110
111template<>
112bool DerivedPathMap<StringSet>::ChildNode::operator==(const DerivedPathMap<StringSet>::ChildNode &) const noexcept;
113
114// TODO libc++ 16 (used by darwin) missing `std::map::operator <=>`, can't do yet.
115#if 0
116template<>
118 const DerivedPathMap<StringSet>::ChildNode &) const noexcept;
119
120template<>
121inline auto DerivedPathMap<StringSet>::operator <=> (const DerivedPathMap<StringSet> &) const noexcept = default;
122#endif
123
124extern template struct DerivedPathMap<StringSet>::ChildNode;
125extern template struct DerivedPathMap<StringSet>;
126
127} // namespace nix
Definition fun.hh:19
Definition derived-path-map.hh:37
V value
Definition derived-path-map.hh:43
std::map< OutputName, ChildNode > Map
Definition derived-path-map.hh:48
Map childMap
Definition derived-path-map.hh:53
Definition derived-path-map.hh:32
std::map< StorePath, ChildNode > Map
Definition derived-path-map.hh:65
void removeSlot(const SingleDerivedPath &k, fun< bool(ChildNode &)> callback)
Definition derived-path-map.cc:52
ChildNode & ensureSlot(const SingleDerivedPath &k)
Definition derived-path-map.cc:8
Map map
Definition derived-path-map.hh:70
ChildNode * findSlot(const SingleDerivedPath &k)
Definition derived-path-map.cc:28
Definition derived-path.hh:105