refactor(treewide): modern C++ idioms
Motivation
This is a tracking PR for my work around C++ modernization. It should not be reviewed, changes will be fished out into individual PRs.
Context
Add :+1: to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.
Some of these are unnecessarily code-churny with little benefit (especially the enum stuff, i.e. lvlError -> Verbosity::Error, tInt -> InternalType::Int). The merge conflicts they cause with open PRs/branches (441+) negate any potential benefit.
I do like using enum struct because the standard allows less verbose switch than regular enums (no need for default always, I think?), and also far fewer implicit conversations.
I don't really think the merge conflict argument against churn holds water anymore because the LLMs will cruise through trivial merge conflicts from changes like that l.