4 ms·
I think it does reduce readability in some scenarios. For instance: const auto& processes = getCurrentlyRunningProcesses(); for (const auto& process:
by Leherenn 2y ago
I think it does reduce readability in some scenarios.
For instance:
const auto& processes =
getCurrentlyRunningProcesses();
for (const auto& process: processes) {
// Ok, what do I do with process now? Is it a pair from a map? A struct from a vector?
// If it's a pair from a map, is the key the pid, a unique id, something else?
}
std::unordered_map<Pid, ProcessData> is more readable than auto here IMO: you don't need to open the definition (or hope your IDE correctly display the type).