-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
contributor-experienceDeveloper experience for Nix contributorsDeveloper experience for Nix contributorsidea approvedThe given proposal has been discussed and approved by the Nix team. An implementation is welcome.The given proposal has been discussed and approved by the Nix team. An implementation is welcome.
Description
We discussed in Nix team meeting on 2022-12-19, that there are multiple instances in the code which follow this pattern:
typedef std::variant<AllOutputs, OutputNames> _OutputsSpecRaw;
struct OutputsSpec : _OutputsSpecRaw {
using Raw = _OutputsSpecRaw;
using Raw::Raw;
using Names = OutputNames;
using All = AllOutputs;
inline const Raw & raw() const {
return static_cast<const Raw &>(*this);
}
inline Raw & raw() {
return static_cast<Raw &>(*this);
}@edolstra asks whether we should do it that way, because it's quite verbose. Also adding aliases like in this case keeps both names around in the codebase.
@Ericson2314 do we have alternatives that are as convenient to use at the call site? Does there speak anything against having the variants as fields?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
contributor-experienceDeveloper experience for Nix contributorsDeveloper experience for Nix contributorsidea approvedThe given proposal has been discussed and approved by the Nix team. An implementation is welcome.The given proposal has been discussed and approved by the Nix team. An implementation is welcome.